Skip to main content

Full text of "The Transactor Magazine Volume 8 Issue 04"



Computer-Generated 
Holography on the C64 

h 

Circles, Elipses 
and Polygons in IVIL 

Projector Update adds 
Hidden Line Removal 



Butterfield explains 
ML Square Roots 

Supporting More Disk 
Formats under CP/M + 



CP/M I/O Redirection 



Reviews: 

Turbo Processor for C64 
Book of ML Routines > 
Merlin C128 Assembler 



Amiga Section: 

Tiny Window Manager 

r g 

Twn New CnlNmn5i_ _ 






I 



rv 



Canacla$4,25 
USA $3.50 



I- -*i 




Articles 



1.1 Depa rtme nts 



HAM Mode 
- Ray Tracy takes an 
in-depth look 

Gno Gurus is Good Gnus 

Blitter Late Than Never 



The Incredible Hunk 

Structure from the 
Black Lagoon 

Directories in Minutes 
with DOS Accelerator! 

GURU Numbers 

We'd Like To C 

Thankless Tasks and 
Due Processes 

Performance Test: 
Medium Slow German 
Fast RAM with 
Two Wait States 



Amiga BITS 

ABSExecBase - Editorial, pg. 4 
ReplyMsg - Reader Malt 
The View Port by Larry Phillips 
ACCESS by Steve Ahlstrom 
Blit Wit 
News LINK 



Feature 



a 




'In 



4l4 



Announcing 

Transactor for the Amiga 

he Magazine For Amiga Programmers 

Premiere Issue to be released 

JANUARY 1988 



. A 



The Potpourri Disk 



Help! 



This HELPful utility gives you instant 
menu-driven access to text files 
at the touch of a key - while ony 
program Is running! 



Loan Helper 



How much is that loan really goirtg 
to cost you? Which interest rate 
con you afford? With Loon Helper 
the answers are as close as your 
friendly 64! 



Keyboard 



Learning how to ploy the piano? 
This handy educational program 
mokes it easy and fun to jeorn the 
notes on the keyboard. 



Flledump 



Examine your disk files FAST with 
this machine language utility. 
Handles six formats, inctudirg hex, 
decimal CBM and true ASCII, 
WordPro and SpeedScrlpt 



Anagrams 



Anagrams lets you unscramble 
words for crossword puzzles and 
the like. The program uses a recur- 
sive ML subroutine for maximum 
speed and efficiency. 



Life 



A FAST machine language version 
of mathematician John Horton 
Conway's ciassic simulation. Set 
up your own ^colonies" ond watch 
them growl 



c 



War Balloons 



Shoot down those evil Nazi War 
Boitoons with your handy Acme 
Connonf Don't let them get away! 



Von Googol 



At lostl The mad philosopher, 
Heigo von Googoi, brings her own 
brand of wisdom to the small 
screen! It this is 'AW then It just ain't 
natural! 



[ 



News 



Save the money you spend on 
those supermarket tabloids - this 
program will generate equaHy 
convincing headline copy - for 
free! 



Wrd 



The ultimate in easy-to-use data 
base programs. WRD iets you 
quickiy and simply create, exam- 
ine and edit Just about any data. 
Comes with sample file. 



Quiz 



Trivia fanatics and students alike 
will have fun with this program, 
which gives you multiple choice 
tests on material you hove en- 
tered with the WRD program. 



AHA! Lander 



AHAI's great lunar lander program. 
Use either joystick or keyboard to 
compete against yourseif or up to 
8 other players. Watch out for 
space mines! 



Bag the Elves 



A cute little arcade-style game; 
capture the elves in the bog as 
quickiy as you can - but don't get 
the good elf! 



Blackjack 



The most flexible blackjack simula- 
tion you'll find anywhere. Set up 
your favourite rule variations for 
doubfirvg. surrendering and split- 
ting the deck. 



File Compare 



Which of those two files you just 
created is the most recent ver- 
sion? With this great utility you'll 
never be left wondering. 



Ghoul Dogs 



Arcade maniacs look out! You'll 
need all your dexterity to handle 
this wicked joystick-buster! These 
mod dog-monsters from space 
are not for novices! 



Octagons 



Just the thing for you Mensa types^ 
Octagons is a chailenging puzzle 
of the mind. Four levels of ploy, 
and tough 'memory' variation 
for real experts! 



Backstreets 



A nifty arcade gome, 100% ma- 
chine language, that helps you 
learn the typewriter keyboard 
while you ploy! Unlike any typing 
program you've seen! 



All the above programs, just $17.95 US, $19.95 Canadian. No, not EACH of the 
above programs, ALL of the above programs, on a single disk, accessed 
independently or from a menu, v/ith built-in menu-driven help and fast-loader. 

The ENTIRE POTPOURRI COLLECTION 

JUST $17.95 USi! 



See Order Card at Center 



Volume 8 
Issue 4 



Vn/«7 



Bits and Pieces . « 6 

ML Break 

Verify Bug 

Sneaky File Print 

Interrupt Routine Management 

Auio-Lineleed Generation 

80-Coiumn Tricks 

Simple Rules for the 128 

1571 Seek-Stopper 

CI28 I/O incompatibility 

Function Key Finagler 

Cursor Save and Restore 

CLl Hint 

AmigaDOS Rollodex Tool 

AmigaBasic Fade-tn 

Letters 12 

Advertising In The Transactor WORKS! 

CP/MlnTheT 

. . .if 1 owned one I would get an 

Amiga magazine! 
Program Listings For Alt Machines 
Transactor Continuing Education Course 
GEOS mice-and-little-piclures environment 
Commodore 1526 Blues 
Macro Assembler Desired 

News BRK 76 

Transactor for the Amiga 

Half Price Until January 1st! 

I Want To Switch! 

I Want Bolhi 

Subscription Renewals and Enquiries 

Mail Order Products: 

The 20/20 Deal 

Transactor Special Offer 

Transactor Mail Order 

World Of Commodore Show 

New England 1987 Computer Fair 

RUN 64 Emulator for Amiga 

Commodore Creating Product List 

New UEDIT Release 

Comspec Hard Drive for Amiga 1000 

ROMDISK with HYPERBOOT for the C64 

MIDI Interface for C64/1 28 and 64C 

GEOS Upgrade for theC128 

Video Digitizer for the C64 

C128CP/MKit 

Aegis "Art Paks" for the Amiga 

Genealogy Program for the 8032 

8051 Cross Assembler for C64/128 

Oxxi Claims Benchmark M2 



• • 



TransBloops 

GAP FILL 

Gart)age Collector Revealed 

Inside View 

C128 Programmer's Aid Fix 

Switchable RS-232 Interface 

Getting Around With Gogo Dancer 

Adding Analog RGB to the 1902 



15 



otcirt r\QQrGSS AnnouncingTVansaciorforthe Amiga! O 

TeleColumn 'T. . 16 

1 ric rrOjGCtOr rari II Anew version with hidden line removal -and more .... lo 

Computer-Generated Holography f^^:%T4^rc64 ..... 29 

L^irClGS lOr inC L^Dt Easy answers to a tough programming problem ol 

Inside CI 28 Cr/M Add support for vinually any CP/M disk format! 4u 

I I I 

CP/M 3.0;PIUS RsdireCtlOn Diverting input and output with get and put . 48 

Square Roots in ML JimButterneldlells how -without floating poind . . , . , 52 

Placeholder for the C64 S^on cursor save and restore routines 54 

I I 



Reviews 

n 

1. Turbo Processor 65C816-ba5edexpansionhardwarefor!heC64with64KRAM 5u 

2. ML Routines for the C64/128 new book from compute! 57 



J, IVlGriin"lZO A 6502 macro assembler developmeni system 

4. Benchmark Modula-2 a Modula-a development system for the Amiga 



58 



■ r^ 



., 59 



Amiga Section 

Amiga Dispatches Jerry explains why or Myron isstm his favourite joystick . . • Uu 

= "'—;. I - ! 

Tiny Window Manager aean up mat Tmy wmdow utterr 70 

The View Port Larry Phimps looks at a hot IBM innovation -multitasking! 52 

rtCCeSS Steve Ahlstrom looks at the best Amiga freely distributable software DD 



Note: before entering programs, see "Verifizer** on page 4 



I - 







>kn*i 






:^^A4 K>^pi>qp^ 













■ 



ABOUT THE COVER: The simulated Workbench windows were done with 
the same typesetting equipment that is used to produce the rest of the 
magazine - a Quadex 5tN)0 typesetting system with a Compugraphk: 8400 
phototypesetter The colour picture in the tower wmdow was done on the 
Amiga by capturing the im^ from the famous "boing" demo(using "zsaveiff" 
from Meridian Software's Zing] package) and editing it with Deluxe Paint Tl. 
The photo was produced using a Polaroid Pallelte system and "Impnnt'^ an 
interface and pr^jram for the Amiga from American Liquid Light, Inc, The 
Polaroid Pallette has an internal CRT and exposes the lilm by displaying 
different parts of the screen image in black and white through a series of 
coloured lilters. The Imprint software loads IF? pk^ture files and controls the 
Polaroid Pallette to take the pictures (using standard 35mm lilm), and gives 
many options to the user tor controlling the process. Thanks lo Commodore 
Canada for the use of the Polarokl Pallette and Imprint equipment. 



The Ttansactof 



January 1968: Volume 6, Issue 04 



Iksisaclor 

Th* Ho9aiJn*lor CoTlinQdw* ProgmmmAK 

Editor-fn-Chier 

KarlJ. H.Hildon 



Publisher 

Richard Evers 

Technical Editor 

Chris Zamara 

SubmlMkHM Editor 

Nick Sullivan 

Customer Service 

Jennifer Reddy 



Contributing 

Ian Adam 
Sieve Ahlslrom 
David Archibald 
Anthony Bertram 
Paul BJair 
Tim Bolbach 
Meal Bridges 
Anthony Bryant 
Jim Burterfield 
Dale A. Castello 
Betty Clay 
Joseph Caifrey 
Tom K. Collopy 
Robert V. Davis 
Elizabeth Deal 
Frank E. DiGioia 
Chris Dunn 
Michael J. Erskine 
Jack Farrah 
Mark Farris 
Jim Frost 

Miklos Garamszeghy 
Eric Germain 

Michael T. Graham 
Eric Guiguere 
Thomas Gurley 
R. James de Graff 
Tim Grantham 
Patrick Haw ley 
Adam Hersl 
Thomas Henry 
John Houghton 
Rol>ert Huehn 
David Jankowski 
Clifton Karnes 
Lome Klassen 



Writer* 

Jesse Knight 
Gregory Knox 
David Lathrop 
James A. Lisowski 
Richard Lucas 
Scott Maclean 
Steve McCrystal 
Stacy Mclnnis 
Chris Miller 
Terry Montgomery 
Ralph Morrill 
DJ. Morris 
Michael Moss man 
Bryce Nesbitt 
Gerald Neufeld 
Noel Nyman 
Matthew Palcic 
Richard Perril 
Larry Phillips 
Terry Pridham 
Raymond Quirling 
Doug Resenbeck 
Richard Richmond 
John W, Ross 
Dan Schein 
E.J. Schmahl 
David Shiloh 
Darren J. ^ruyl 
Aubrey Stanley 
David Stidolph 
Richard Stringer , 
Anton Treuenfels 
AudrysVilkas 
Jack Weaver 
Geoffrey Welch 
Evan Williams 



Program Listings In Transactor 

All programs listed in Transactor will appear as they would on your screen in Upper/Lower case 
mode. To clarify two potential character mix-ups, zeroes will appear as '0' and the letter "o" will of 
course be in lower case. Secondly, the lower case L (T) is a straight line as opposed to the number 1 
which has an angled top. . .^ ? • ' 

Many programs will contain reverse video characters that represent cursor movements, colours, or 
function keys. These will also be shown exactly as they would appear on your screen, but they're 
listed here for reference. Also remember; CTRL-q within quotes is identical to a Cursor Down, et aL 

Occasionally programs will contain lines Ihat show consecutive spaces. Often the number ol spaces 
you insert will not be critical to correct operation of the program. When it is, the required number of 
spaces will be shown. For example: 



print ■ 



:i ^.-1 



•.- 



-.•i 



Push right " - would be shown as - print "[10 spacesjflush right ' 



j ■ . ■ J 

Cursor Characters For PET / CBM / VIC / 64 



Down - Q 
Up -■ 
Right - ■ 
Left - [Lft| 
RVS 
RVSOff- 



liuert 
Delete -Q 
Clear Scm - P 
H<Hiie - Q 

STOP - B 



r. 



. I ^ 



1 -H I 



Colour Characters Fbr VTC / 64 



Black - 
White - 
Red - 
Cyan - [Cyn] 
Purpte- IPurj 
Green - ■ 

BIw - Bi 
Yellow- [Yell 



3 



'^ 



Orange - 
Brown 

LI. Red - 

Greyl - 

Grey 2 - 
Lt Green - 

U.BhK - 

Grey 3 - [Gr3| 



h . 



I 1 



. ../M- -■ :^f. 



< 



I- . 



Function Keys For VIC / 64 



Fl 
F2 
F3 
F4 



F5- 
F«- 
F7- 
F8- 



> ! ' H 



■i _ ■ ■ H I 



Please Note: Transactor's 
phone number is: (416) 764-5273 



Production 

Attic Typesetting Ltd. 

Printing 

Prinled in Canada by 
Maclean Hunter Printing 



CompuServe Accounts 

Contact us anytime on GO CBMPRG, GO CBMCOM. or EasyPlex at: 

KarlJ.aHiidon 76703,4242 
Chris Zamara 76703,4245 
Nick Sullivan 76703,4353 



Transaclor is pubJished bi-nwiWhly by TranMclor PubHshing Inc , S5 Wesl Wllmol Sireel. Unil 10. 
RichTTwnd Hill. Onlario. LAb 1K7- Canddiiin Second CJass mail regislralion number 6342. LSPS 725- 
050> Second Class posTage pad M Buffalo, WY. (or US. substnbers U.S. Po^lrriaslers mfkI address 
ch^nBesloTransattQT, P-0. iiy>L33B.SlAifonC. Burralo. NY. 14309 ISSN'' 0827 2530. 

TVansaclor is in no wnycdrt lifted TA" lib Comrm^dore Business VTjirhJne^ 

ComcTio<k]reand03mmodoreproductnaiT]ei[Pt^^^ 128, AmLga) are roistered lrade]iiarks of 

CoitiiTiodure Inc. 

Sub^riplnns: 

Canada tl9 Cdn_ U.S.A. 115 US. All olher !2l US 
AirMail{OvtRMSortly)$40US.(£4.15po5la8e/issye) 

Send all «ub«crlptlo<u lo: lYansaclDr. SubscriptLons Departmenl. S5 WesI Wilnur Slreel. Umr 10. 

Richmond Hill, Oniarb. Canada. L4B 1K7, 416 764 5273 Note: SubbtTipibns are handled ai (his adfli^s_s 
ONLY. Subscriplions sen! To our Bulfalo address (above) will be forwarded lo ouf Richmond Htll HQ. For 
beslresullSi use poslage paid card alcenler ol magajme 



Quaality Orders 

In Canada: 

Ingram Sotlware Lid. 

1 A 1 AdtiSc Drive 
Concord. Onlarin 
UK2Wr 
(416] 738-1700 



inlheUS.A.r 

IPD (InlernalbonaL Periodicat Distributors) 

1 17fifrB Sorrento Valley Road 

SanDiefiOHCalalornid 

92121 (619)4815928 

Ask lor Dave Bruescher 



SOU>Oirr:TheBeslo[TheT>ansaclorVotumes]*2&3;Vol4l5Sues03.04.05,06,aM^ 

03, f>4 are available on microlicbe only 
SllllAvftllftble:Vol--l 01,02 Vol 5 01. 01. 05. 06. Vol fi 01. 02. 03. t>4. 05, 06 _ 

\fel. 7: 01, 02. 03. 04, 05. 06 Vol 8.01.02.03.04 ^ 

^^ ^- - . -/'* v.r 
Back Iwties: $4 50 each Order all back issues Irom PicfajPlil Hill HQ. 



Edironal contribulk>ns are alwfly$ welcome Minimum remuneration ^s HO [>er priwed page. Preferred 
mediaare 1541. 203K4040. 8050. 8250J571. or liiBl diskeries with WordPro. PaperTlip, PotkeTWnler, 
WordCrafl.SuperKripr(aclually.]USUhQur any word processor files) or SEQtex^ 

diskefleswilb ASCII lestliles pTOftramlislinfis iiK^ludjiig BITS i>ubsniisstoris of more (ban a few tines should 
be provided on disk Manusirtp^slvnjldbelypewrillen.doublespai^ed.wilhspectaicharaclers or formal^ 
dearly marked Pbotosshwildbeglossy black and white prinls llluslralJonsshngld be on while paper wilb 
black ink only. 



All material accepled becomes the properly of TranvicLor All malenaJ is copyrigbl by Transactor 
PiibLk:aik>ns Inc. Reprodutrion in any form wliboul permission is in viulaiicin c^ applicable laws. Solkiied 
material i& accepted on an all righl^ baiii unly Write lo Ihe Rkhmond Hill address for a writers package. 
^lleoptnlonsexpresscdincon^^lbutedd^ttLlesartrK^r necessarily llwseolTransacI^^^ 
a [nd|orob|eclive. Transactor cannor assume liabi I uy lor errors in arlKlesor prc^ams Prcigrams lisled In 
TYanSdOnr, and/or appearing on Transactor disks, are capyrighl by Transactor Publishing In^ and may not 
be dL]plicaled or dislnbuted wilhoul permission 



Tho Transoctor 



Joniiary 1988: Volume 8, Isnie 04 



Transactor for the AMIGA 



— i- 



■.^^• 



• i- 



t..i 



Inching Toward The Magazine Rack 

Like asking a girl out for the fir^ time, we're getting back into retail distribution. 
Cautiously, and after miich rehearsal, we have slarted our approach, . . an 
aj^roach that comes only after several months of investigaling the mechanics d 
that stationary fixture known as "the magazine rack". 

For those who subscribed based on our landmark decision to go off the news 
stands, please don't feel tricked. At the time, we had to do it - we simply cooldn'l 
afford to ccmtinue. And we are by no means getting back into "news slarxl" 
dislribution. We won't be available at the grocery stor^, the k)cai variet>' store or 
smoke shop, the hotel confectionery, or in train stalkms and airports. It's these 
places that are truly defined as "newsstand", A print run to cover Ihe shelf space 
in all those places would be four or five times our immediate objective and any 
attempt to tackle such an objective wouki send us ^iralling right back out of the 
distribution business to square L 

Computer shops and book stores, on the other hand, are known among 
publishers as "singl6<:opy " outlets. Our singlecopy sales alw^ came in at 
around 100%, and it was the news stand sales that ruined our average. Time 
after time in city after city the story we always hear is, 'By the time ( gel there, 
TVansactor is sokJ out". But "there" was always this book store or that computer 
store. We could be wrong, but it's become apparent to us that Transactor readers 
generally don't go to the news stand to get their copy and, although it's not 
impossible that TVansactor will show up at one or two of the millions d this type 
of outlet, it's highly unlikely that the distributkin we're seeking will include them 
as a premeditated (arget. 

We are, however, actively seeking pathw^ to the singlecopy type outlets that 
dkl so well for us before: Waldenbooks, B. Dalton stores, Crown Books, Encore 
Books, Sdlware Etcetera and Corr^terLand; and in Canada W.H. Smith, 
Classic Bookstores, Coles and Lichtman's. We also want to ship to every 
computer shop on the planet that carries Commodore equipment. 

We've made arrangements so far with a couple of marine dislribulors, and any 
retailer you know is nx>re than welcome to contact them directly. Their names 
are opposite on page 2. If neither is within reasonable gera^raphk: proximity, call 
us. By the time this edition reaches you we may have more regional distributors 
that we can recommend. 

Some readers have told us that they wouldn't subscribe even if they couldn't get 
Transactor any other way. And uri fortunately for us they've kept their word. But 
even mt»e unfortunate is the fact that this page 3 will not reach them, except, 
perh^, t^ accident. Because even more important than this devebpment is 
the following r>ews so many have been anxiously awaiting. 

Announcing Transactor for the Amigal 

AmiEXPO in New York was the most electric computer show I've been to since 
the first WorW d Commodore show in Toronto. No shortage of adrenalin there - 
stories of "all-nighters" for last minute preparatbns were common conversatk^n. 
Exhibitors and attendees came from as far as California. Vancouver, Great Britain 
and Germany. One report had attendance Figures at 4,000 for the first d^. 1 had 
my doubts at first, but when I stopped to consider that the seminars were filled to 
capacity while at the same time the exhbit floor was packed tight, 4,000 seemed 
like a conservative estimate, .-- — - - 

We made the trip for a couple d reasons. Just seeing the show was well worth 
the eft)rt, but spreading the word about 'Transactor for the Amiga" brought 
overwhelming reactions from everyone, if only we'd had subscription forms 



with us) Even the staff of other mai^ines exhibiting at the ^low agreed that a 
high-tech puma! for the Amiga was sorely needed and that they were glad to see 
us producing one - wonder if they really meant it. 

If you own a modem, chances are you're already aware of this news. We've 
made similar announcements on just about every popular online service in 
North America including CompuServe, PeopieLink, BIX, GEnie, Quantum Link 
and PunterNet, , 

To elaborate. Transactor for the Am^ will not be at all unlike the original 
Transactor. We intend to publish artKles of interest to pn^rammers and 
hobbyists with an appetite for fat-free infonnation that doesn't leave you feeling 
hungry again a short lime after digesting it. A sample of what will appear come 
January is on the cover of this issue; however, don't take the article titles 
seriously, as if that need be sakj. We have bts of material lined iq) but didn't 
know if it would all appear in the premiere issue or if some would end up in the 
second issue, So we took the opportunity to have some fun instead. 

Qy the wc^, if >^u have an idea for an article, please get in touch. We talked to 
several authors at the show and gave out a number of writer kits. Some already 
had artkles assembled. . . artk:les that were declined by some of the other 
magazines because they were "too technkial". In our opinkm, there's no such 
thing as "too lechnk:a]", so if you're in a similar situatbn, or know someone who 
is, send us your stuff or give usa call 1 know when I invest time in a project that 
gets shelved for one reason or another, and then find a use lor that work later on, 
it's like getting something for nothing. If the work gets published, then that 
"something" usually turns into money - arwl that's nrce! 

A charter subscription offer will be in effea until January 1 . 1988. , , an offer that 
will never be repeated. It comes to HAU the regular price and a whopping 64^ 

off the cover price. See News BRK and the sub card tor more. We've addressed 
many reader comments about the advantages of buying at the magazine rack 
such as getting damage free copies and a cover without an ugly mailing label 
stuck cm it Starting with this issue, all 'T' AND "T-A" subscribers will receive 
their copies in what our printer calls "a poly bag" - a supermarket type word for 
a piece of plastic that's hermetically sealed on three skies around the mag. 
Regardless, it should mean that if any damage occurs, you'll be able to toss the 
damage AND the label right irUo the trash, leaving a fresh, crisp, good-as-slore- 
bou^t Transactor in hand. ,- ■, ■ - . 

Not mentbned anywhere else in this issue are our two incredible advertising 
offers also in effed until January 1 only. Ad rates in Transodor for //le^tm^ will 
for now be the same as in Ihe original Transactor. But advertisers who take out 
space in the premiere issue of T-A will want to know about: 1) TTie Deep 
[Mscount Deal - a full 50 % off ads in our first issue, and 2) The Double Exposure 
Deal - two ads for the price of one. Race any ad in the December issue of 
Transaaor and gel the same size ad in the Premiere Issue of Tmnsactor tor the 
Amiga, ABSOLUTELY Ff^E! At first glance this appears to be '1 for 5, 2 fw 1 0" 
logic, but under plan 2, ads will reach Christmas shoppers. Again, if you're 
interested, or know someone who is, please call us soon. Although ChrisUnas is 
still a while avray, our deadlines are rapidly approaching and the pressman waks 
for nobody! 

Lastly, some d you may be recalling prevkxis editorials where I cite enormous 
work loads coupled with unbearable schedules and saying, "you guys must be 
crazy - as if one mag wasn't enough, now you'll have twof". Well, we've always 
been a little crazy, and if you think an occupational environment like that might 
suit you. we're currently accepting resumes. 

Karl J.H, Hildon, Editor in Chief 



The Tronsoctor 



January 1988: Volume 8, Istue 04 



Using "VERIFIZER" 



■ ^. 



_^ 



The Transactor's Foolproof Program Entry Method 



^n^^h 



VERIRZER should be run before typing in any long program from the 
pages of The Transactor It will let you check your work line by line as 
you enter The program, and catch frustrating typing errors. The VERIFI- 
ZER concept works by displaying a two-letter code for each program 
line which you can check against the corresponding code in the 
program listing. 

There are five versions of VERIFIZER here; one for PET/CBMs, VIC or 
C64. Plus 4, C 1 28, and Bl 28, Enter the applicable program and RUN it. 
If you get a data or checksum error, re-check the program and keep 
trying until all goes well- You should SAVE the program, since you'll 
want to use it every lime you enter one of our programs. Once you've 
RUN the loader, remember to enter NEW to purge BASIC text space. 
Then turn VERIFIZER on with: 

SYS 634 to enable the PET/CBM version (off: SYS 637) 
SYS828 to enable the C64A/IC version (off:SYS831) 
SYS 4096 to enable the Pius 4 version (off: SYS 4099} 
SYS 3072,1 to enable tfie C1 28 version (off: SYS 3072,0) 
BANK 15: SYS 1024 for 8128 (off: BANK 15; SYS 1027) 

Once VERIFIZER is on, every time you press RETURN on a program 
line a two-letter report code will appear on the top left of the screen in 
reverse field. Note that these letters are in uppercase and will appear as 
graphics characters unless you are in upper/lowercase mode (press 
shift/Commodore on C64/VIC)- 

Note: If a report code is missing (or "— ") it means we've edited that 
line at the last minute wfiich changes the report code. However, this 
will only happen occasionally and usually only on REM statements. 

With VERIFIZER on, just enter the program from the magazine nor- 
mally, checking each report code after you press RETURN on a line. If 
the code doesn't match up with the letters printed in the box beside the 
listing, you can re-check and correct the line, then Try again. If you 
wish, you can LIST a range of lines, then type RETURN over each in 
succession while checking the report codes as they appear Once The 
program has been properly entered, be sure to turn VERIFIZER off with 
the SYS indicated above before you do anything else. 

VERIFIZER will catch transposition errors like POKE 52381 ,0 instead 
of POKE 53281,0. However, VERIFIZER uses a "weighted checksum 
technique" that can be fooled if you try hard enough; transposing two 
sets of 4 characters will produce the same report code but this should 
never happen short of deliberately (verifizer could have been designed 
to be more complex, but the report codes would need to be longer, and 
using it would be more trouble than checking code manually). VERIFI- 
ZER ignores spaces, so you may add or omit spaces from the listed 
prc^ram at will (providing you don't split up keywords!). Standard 
keyword abbreviations (like nE instead of next) will not affect the 
VERIFIZER report code. 

Technical info: VIC/C64 VERIFIZER resides in the cassette buffer, so 
if you're using a dataselte be aware that tape operations can be 
dangerous to its health. As far as compatibility with other utilities goes, 
VERIRZER shouldn't cause any problems since it works through the 
BASIC warm-start link and jumps to the original deshnation of the link 
after it's finished. When disabled, it restores the link to its original 
contents. 



CI 

CF 

LI 

HC 

DM 

GK 

OG 

JO 

AF 

IN 

ON 

IB 

CK 

EB 

HE 

01 

JB 

PA 

HE 

EL 

LA 

Kl 

EB 

DM 



KE 

JF 

LI 

BE 

DH 

GK 

FH 

KP 

AF 

IN 

EC 

EP 

OC 

MM 

MG 

DM 

CA 

NG 

OK 

AN 

GH 

JC 

EP 

MH 

BH 



PET/CBM VERIFIZER (BASIC 2.0 or 4.0) 

1 rem* data loader for Verifizer 4,0" • 

15 rem pet version 

20 cs = 

30fori^634to754:reada:pokei,a 

40cs = cs + a;nexli , _ ^ . - 

50 : 

60 if CSO15580 then print'***** data error "•••f': end 

70 rem sys 634 -i^ 

80 end , 

100: 

lOOOdata 76,138, 

1010 data 173, 164, 

1020 data145, 201, 



'■■t^^-L... 



I " I 



'i f =- 



2.120.173,163, 2,133,144 
2,133,145, 88, 96, 120, 165 
2,240, 16,141,164, 2,165 
1030 data 144, 141,163, 2, 169, 165, 133,144, 169 
1040 data 2,133,145, 88, 96, 85,228,165,217 
1050data201, 13,208, 62,165,167,208. 58,173 
1060data254, 1, 133,251, 162, 0, 134,253,189 
1070 data 0, 2,168,201, 32,240. 15,230,253 
1080dala165,253, 41, 3,133,254, 32,236, 2 
1090 data 198, 254, 16,249,232,152,208,229,165 
1100data251, 41, 15, 24,105,193,141, 0,128 
mOdata 165,251, 74, 74, 74, 74, 24,105,193 
1120 data 141, 1,128,108,163, 2,152. 24,101 
1130data251, 133,251, 96 " ' 



VIC/C64 VERIFIZER 



■: 1 , 



'.'- I. 



10 rem* data loader for Verifizer" • 

1 5 rem vic/64 version 

20cs = 

30 for i = 828 to 958:read a;poke i,a 

40cs = cs + a:nexti 

50: 

60 if osOl 4755 then print'***** data error ******: 

70 rem sys 828 

80 end 

100: 

1000 data 76, 74, 

1010dala252, 141, 

1020 data 3,240, 

1030 data 251, 169, 

1040 data 3, 3, 

lOSOdala 0,160, 

1060 data 32,240, 



F. 



^ 



l-\ 



end 



-^ 



1070data133, 90, 
1080 data 232, 208, 229, 56, 
1090 data 32,210,255, 169, 
llOOdala 89, 41, 15, 24,105, 
11 10 data 165, 89, 74, 74, 74, 
1120 data 32,210,255,169,146, 
llSOdata 32,240,255,108,251, 
1140datal01, 89.133, 89, 96 



3, 165,251, 141, 2, 

3, 3, 96,173, 3, 

17, 133,252, 173, 2. 

99,141, 2, 3,169, 

96,173,254, 1,133, 

0,189, 0, 2,240, 

91,200,152, 

3,198, 90, 

32,240,255,169, 

18, 32,210,255, 



15, 133, 
32, 183, 



3, 

3, 

3, 

3, 

89, 

22, 

41, 

16, 



97, 32,210, 

74, 24, 105, 

32,210,255, 

0,165, 91, 



165 

201 

133 

141 

162 

201 

3 

249 

19 

165 

255 

97 

24 

24 



VIC/64 Double Verifizer Steven Walley, Sunnymead, CA 

■'■■.- ■ " 

When using 'VERIFIZER' with some TVs, the upper left corner of the 

screen is cut off, hiding ttie verifizer- displayed codes, DOUBLE VERI- 
FIZER solves that problem by showing the two-letter verifizer code on 
both the first and second row of the TV screen. Just run the below 
program once the regular Verifizer is activated. 






Tho Transactor 



January 1988: Volume 8, Issue 04 



100 tor ad = 679 to 720:read da:poke ad,da;nexl ad 

110sys679: print: print 

1 20 prinfdouble verifizer activated "mew 

130data120, 169, 180, 141, 20, 3 

140data169, 2, 141, 21, 3, 88 

150data96, 162, 0,189, 0,216 

160data157, 40,216,232,224, 2 

1 70 data 208, 245, 1 62, 0, 1 89, 

180 data 4,157, 40, 4,232,224 

190 data 2,208.245, 76, 49,234 



- \ 



VERIFIZER For Tape Users 



Tom Potts, Rowley, MA 



The following modifications to the Verifizer loader will allow VIC and 64 
owners with Datasetles To use the Verifizer directly (without the loader)- 
After running the new loader, you'll have a special copy of the Verifizer 
program which can be loaded from tape wilhout disrupting the pro- 
gram in memory. Make the following additions and changes to the VIC/ 
64 VERIFIZER loader: 

NB 30 for i = 850 to 980: read a: poke i, a ^ 

AL 60 ifcs<>14821 then print'*--'*dataerror«""*": end 

IB 70 rem sys850 on. sys853 off 

— 80 delete line 

— 100 delete line 

OC lOOOdata 76, 96, 3.165,251,141, 2, 3,165 

MO 1030data251, 169, 121,141, 2, 3,169, 3,141 

EG 1070data133, 90, 32,205. 3,196, 90. 16,249 

BD 2000 a$ = Verifizer.sysSSOlspace]" 

KH 2010 for I = 850 to 980 

GL 2020 a$ = a$ + chir$(peek(i)): next 

DC 2030open 1,1, 1,a$: close 1 

IP 2040 end 

Now RUN, pressing PLAY and RECORD when prompted to do so (use a 
rewound tape for easy future access). To use the special Verihzer that 
has just been created, first load the program you wish to verify or 
review into your computer from either tape or disk. Next insert the tape 
created above and be sure thai it is rewound. Then enter in direct 
mode: 0PEN1:CL0SE1, Press PLAY when prompted by the computer, 
and wait while the special Verifizer loads into the tape buffer Once 
loaded, the screen will show FOUND VERIFIZER.SYS850. To activate, 
enter SYS 850 (not the 828 as in the original program). To de-activate, 
use SYS 853. 



Dl 


1140 data 20, 


133,208, 


162, 0, 


160, 0,189 


LK 


1 1 50 data 0, 


2,201, 


48, 144, 


7,201, 58 


GJ 


1160 data 176, 


3, 232, 


208, 242, 


189, 0, 2 


ON 


1 1 70 data 240, 


22,201, 


32, 240, 


15,133,210 


GJ 


1180 data 200, 


152, 41, 


3, 133, 


209, 32,113 


CB 


1190 data 16, 


198,209, 


16,249, 


232,208,229 


CB 


1200 data 165, 


208, 41, 


15, 24, 


105,193,141 


PE 


1210 data 0, 


12, 165, 


208, 74, 


74, 74, 74 


DO 


1220 data 24, 


105, 193, 


141, 1, 


12, 108,211 


BA 


1230 data 0, 


165,210, 


24, 101. 


208. 133,208 


BG 


1240 data 96 









L H 



PK 

AK 

JK 

NH 

OG 

JP 

MP 

AG 

ID 

GF 

MG 

HE 

LM 

JA 

El 

KJ 

DH 

JM 

KG 

EF 

CG 

EC 

AC 

JA 

CC 

BO 

PD 



C128 VERIFIZER (40 column mode) 

1 000 rem * data loader for "verifizer c1 28' 
1 01 rem * commodore c1 28 version 
1 020 rem * use in 40 colLmn mode only! 
1 030 cs = 

1 040 for j = 3072 to 321 4; read x: pokej.x: chi = cfi4-x: next 
1 050 if chOI 7860 tfien print 'checksum error": slop 
1060 print "sys 3072,1: rem to enable" 
1070 print "sys 3072,0: rem to disable' 
1080 end < ■ ■ 

1090dala208, 11,165,253,141, 2, 3,165 ■' 
1100data254, 141, 3, 3, 96,173, 3, 3 
1110data201, 12,240, 17,133,254,173, 2 
1120 data 3,133,253,169, 38,141, 2, 3 
1130data169, 12,141, 3, 3, 96,165, 22 
1140 data 133, 250, 162, 0, 160, 0, 189, 
1150data 2,201, 48,144, 7,201, 58,176 
1 160 data 3, 232, 208, 242, 1 89, 0, 2, 240 
1170data 22,201, 32,240, 15,133,252,200 
1180data152, 41, 3,133,251, 32,135, 12 
1190data198, 251, 16,249,232,208,229, 56 

1200data 32,240,255,169, 19, 32,210,255 
1210datal69, 18, 32,210,255,165,250, 41 
1220data 15, 24,105,193, 32,210,255,165 
1230data250, 74, 74, 74, 74, 24,105,193 
1240data 32,210,255,169,146, 32,210,255 
1250 data 24, 32,240,255,108,253, 0,165 
1260data252, 24,101,250,133.250, 96 



: ■-■rl 



L'' 



^^ 



B 128 VERIFIZER 



Elizabeth Deal, Malvern, PA 



If you are gning to use tape to SAVE a program, you must deactivate 
(SYS 853) since VERIFIZER moves some of the internal pointers used 
during a SAVE operation. Attemphng a SAVE without turning off 
VERIFIZER first will usually result in a crash. If you wish to use 
VERIFIZER again after using the tape, you4l have to reload it with the 
OPENliCLOSEl commands. 



Plus 4 VERIFIZER 



Nl 
PM 
EE 
NH 
Jl 
AP 
NP 
JC 
ID 
PL 
CA 
OD 
LP 
EK 



1 000 rem * data loader for Verifizer + 4" 

1010 rem * commodore plus/4 version 

1 020 graphic 1 : scnclr: grapfiic 0: rem make room for code 

1030 cs = 

1040 for J = 4096 to 4216: read x: pokej,x: cfi = ch-t-x: next 

1050 if ch<>13146 then print 'checksum error": stop 

1060 print "sys 4096: rem to enable" 

1 070 print "sys 4099; rem to disable" 

1080 end , . 

1090data 76, 14, 16,165,211,141, 2, 3 

1100dala165,212, 141, 3, 3, 96,173, 3 

mOdata 3,201, 16,240, 17,133,212,173 

1120data 2, 3,133,211,169, 39,141, 2 

1130data 3,169, 16,141. 3, 3, 96,165 - 



1 remsave"@0:verifizerbl28",8 

10 rem* data loader for Verifizer b128"* 

20C3 = 

30bank15:fori = 1024 to1163:reada:pokei,a 

40cs = cs + a:next I 

50 if CS01 6828 then print"** data error *•': end 

60 rem bank 15: sys 1024 

70 end 

lOOOdata 76, 14, 4,165,251,141,130, 2, 

1010 data 141, 131, 2, 96, 173, 130, 2,201, 

1020data 17, 133,251, 173, 131, 2, 133,252, 

1030 data 141, 130, 2, 169, 4,141, 131, 2, 

1040data 1, 72,162, 1,134, 1,202,165, 

1050 data 233, 32, 118, 4,234, 177,136,240, 

1060 data 32,240, 15,133,235,232,138, 41, 

1070data234, 32,110, 4,198,234, 16,249, 

1080data230, 165, 233, 41, 15, 24,105,193, 

1090 data 208, 165,233, 74, 74, 74, 74, 24, 

I100data14l. 1,208, 24,104,133, 1.108, 

1110data165,235, 24,101,233,133,233, 96, 

1120data164, 137, 133, 133, 132, 134, 32, 38, 

1130data 32, 78,141,165,133, 56,229.136, 

1140data170, 170, 170, 170 



165,252 

39, 240 

169, 39 

96, 165 

27, 133 

22, 201 

3, 133 

200, 208 

141, 

105,193 

251, 

165, 136 

186, 24 

168, 96 



The Ttanvoctor 



^nuarv 1985: Vblume 8, Issue 04 



^v ■- r I 



-J .1 ' n . ' 



-y - 



I • I--- 
V V - 



H 



.0^' ■ 



.-■■u .i'>^ ' ■ 



t 
^,1 






Ji 



■.7" 




- N- 



Got an interesUng programming tip, short routine, or an unknown bit of 

Commodore trivia? Send it in - if we use it in the Bits column, we 'It credit you in 

the column and send you a free one-year's subscription to The Transactor 



-■[^ 



-^il - 



ML Break 



Amir Michail 
WUlowdale, Ontario 



"ML Break" is a debugging tool that lets you cleanly exit from a 
machine language program by hitting the RESTORE key. Whal's 
more, the program counter (the address of the next instruction to 
be executed) is printed to the screen so you can see what the 
program was doing when you stopped it. Very handy for finding 
out where a program is getting hung up, and as a cleaner 
alternative to RUNSTOP/ RESTORE. 

I 

Since Ihe RESTORE key generates an NMI (Non-Maskable 
Interrupl), which "ML break" intercepts, you can gel out of just 
about any crash. 



JM 

NO 

PE 

MN 

MH 

KN 

EB 

EJ 

EE 

JF 

GA , 

PE i 

LA ; 

DN i 



TOO rem "ml break" by amir michail 

T10forj = 710toj + 49 

120 read a: c = c + a: poke j, a: next 

130 if C05626 then prinfdata error!";stop 

140 poke 792,198: poke 793,2 

1 50 prinffiil 'restore' to break" 

160: 

170 data 169, 247, 162, 2,141, 24, 3,142 

180 data 25, 3, 32,225,255,208, 3, 76 

190data 71,254,169, 42, 32,210,255,104 

200 data 104, 170,104, 32,205, 189, 169, 164 

210 data 72,169,116, 72,169, 32, 72,169 

220 data 198, 162, 2,141, 24, 3,142, 25 

230 data 3, 64 



r' " ■■■' I ■■■ ■■'■-.■- ■ ^-i' ■'>>■ -''.-■ ■■■ .i...- . ... 



,iJ- I 



I , 



1 '■ 



J -^ 



J. M i-^i| ^ .-i' 



■ - I I 



NK 
LG 
CA 
OJ 
GL 
CL 
MF 
GM 
CE 
NK 
EP 
MB 
10 



260 
270 
280 
290 
300 
310 
320 
330 
340 
350 
360 
370 
390 back rti 



-'i 



p<a ihigh byteof pc 

jsr $bdcd ; print pc 

Ida #>basentr ;put entry point on stack 

pha -.-■,■ I- I - ;k ;a 

Ida #<basentr ;so that the rti brings us there 

pha ■ ,-- - ^ 

[da #$20 ;cleared flags for status register 

pha 

ida ^break ;restore vector 

Idx #>break ;lo this routine 

sta nmivec 

stx nmivec +1 



- i I J 



or.. 



j^ 1 ' 






' • 



! ,^ 



. ■ ' .,-'n 



'"i'^ N^ 



Verify Bug . 



Kevin Hisel and Kevin Hoplcins 

Cliampalgn, IL 



I - 



h Ti ( ' 



We have uncovered a bug we have never seen mentioned 
before. It is with the VERIFY command in C64 and C128 BASIC 
(and presumably other versions as wellj. , , , . 



•-'^ 



-. < 



During the development of a program that copies files, a little 
bug cropped up that consistently truncated the last block of the 
file. While this is all in a day's work for the plucky BASIC 
prog rammer/ bug- hunter, its cause momentarily escaped us. 
Trying to figure out why our 55 block program was now 54, we 
VERIFYed the 55 block version (in memory) against the 54- 
block file. Of course, we knew that we would get the traditional 
'7VERIFY ERROR^^ but to our utter horror and disbelief, our 
seemingly undamaged machine reported, ''OK**, 



Source code for ML Break 



LH 
IL 
DO 
MP 
LG 
KE 
BH 
OP 
DB 
HO 
Cf^ 
JC 
PG 
Ffvl 



100 nmivec = 
llObasentr == 
130 break Ida 
140 Idx 

150 sta 

1 60 ' stx 
1 70 jsr 

180 ' bne 

^ 90 imp 

210break2 Ida 
220 jsr 

230 pla 

240 pla 

250 tax 



792 ^ 

$a474 

#<back 

#>back 

nmivec 

nmivec + 

$ffe1 

break? 

$fe47 

#42 

$ffd2 



1 



; system vector 
;basic entry point 
;disable interupt 
;by pointing vector 
;to 'rti' 

_ * ri I 

icheck Stop key 
;continue it not pressed ' 
;go to normal entry 
;print an asterisk 
;in front of pc ' 

idiscard status register value 
;lowbyteof pc 



'if 



[t seems that VERIPi' does not care if the file on disk is shorter 
than the program in memory. As long as the disk file matches 
memory in the machine up to the end of the file, VERIFY will not 
report an error. Admittedly this condition will rarely occur, but 
here is how to duplicate it: 



' V 



1 , Save your favourite BASIC program to a spare disk. 

2, Using your favourite sector editor (like Disk Doctor), truncate 
the file by writing a zero byte in(o the first position of a sector 
near the middle of the file. (This won't affect the block count 
in the directory unless you copy the file somewhere else.) 

3. Load the original program into memory. , i ■. 

4. VERIFY it against the truncated version. - '" " 



The Transactor 



January 1988: Volume 8, Issue 04 



Your silly computer happily reports that the two progrdms are 
identical! But try to LOAD and RUN the truncated version and 
you will see that this is simply untrue! . 



Sneaky File Print 

To easily output a SEQ file to a printer: 

load"(ilename,s\8 

{hit RUN/STOP RESTORE if system hangs) 

save"title" + chr$(13),4 

That's it! 



Amir Michail 



»^ 



^ ^^--1 






T h' 



^- 



-K 



I ^ 



- i, 



_. , :. J 



Y I 



Interrupt Routine Management 

Installing an IRQ-driven routine is not too difficult, but if you 
wish to be able to add new IRQ routines without disturbing 
current ones, and remove any individual IRQ routine, things can 
get messy. The following short routines make up an interrupt 
handler system that makes adding and removing IRQ routines 
(interrupt servers) simple and efficient. 

There are four subroutines here: INSTHDLR, KILLHDLR, 
ADDSKVR, and REMSRVR. INSTHDLR is called once to install 
the IRQ handler system, and KILLHDLR is called to remove it 
before your program exits. 

Once the handler is installed, adding a server to the interrupt 
chain is accomplished by simply calling ADDSRVR with the 
address of the subroutine to install in the accumulator (low) and 
y register (high). You will get back the number for that server in 
the X register; the server number is used to identify a server for 
removal. 

To remove a server, just call REMSRVR with the server number 
in the x register. . ^ 

You will appreciate the benefits of managing your interrupts 
with this system the first time you use it in a program- You never 
have to think about anything when you want extra work done 
during interrupts; just write the subroutine, and call ADDSRVR 
where you want it activated. When it comes time to shut it off. 
just REMSRVR it at the appropriate place. ■ - . ■ 

It works by simply putting JSRs to the server subroutines in a 
chain that ends with a JMP to the original IRQ destination 
(usually, but not necessarily, the Kernal IRQ entry point at 
$EA31). Unused server slots in the chain are filled with three 
NOPs to take the place of a JSR. A server is added to the chain by 
having a JSR followed by its address placed in the hrst empty 
(NOP-filled) slot in the server chain, and removed by having the 
JSR simply NOPped out. Simple, perhaps, but it works like a 
charm. 

The system as listed can handle up to four interrupt servers. 
This number can be changed to any size you need by changing 



the assembler variable IHENTRIES. Each additional server 
added to this maximum uses three more bytes in the server 
chain, and causes three extra NOPs to be executed every IRQ. 



- - H 



-- ^ ^ 



In case you haven't guessed, the inspiration for these routines 
fomes from the Amiga's AddlntServer, RemlntServer, and 
SetlntHandler functions. Now you can program interrupts on 
your 64 just like they do on the Amiga (well, almost), 

L ■ 

Interrupt Handler System 



JN 

!G 

PG 

OB 

Gl 

AH 

KJ 

JP 

GE 

IL 

PK 

MM 

GN 

HA 

BK 

KG 

OP 

lA 

OP 

JO 

iA 

AG 

CI 

AC 

10 

IF 

EK 

PI 

OF 

GF 

KB 

MJ 

HH 

EE 

CL 

HJ 

LJ 

HK 

AC 

CD 

00 

OG 

CA 

MA 

DN 

CM 

MG 

HP 



- r 



n. 



-I "i -.^ 



r- 



1000 ; interrupt handler system 

1010; 

1020;insthdlr, killhdlr, 

1030 ; addsrvr, remsrvr 

1040; 

1050tempveo= $fb 

1060; ■ ,,■ 

1070ihentries= 4 . 

1080 ; increase if necessary 

1090; 

1100chainlen= ■ ihentries*3 

1110 

1120 

1 1 30 ihchain * = * + chainlen 

1 1 40 ; server chain goes here 

1 1 50 rts 

1160 

1170 

llSOinsthdIr = • 

1190 ; install the interrupt handler 

Idy #chainlen- 1 

Ida #$ea 



r ' - 



('■_■>■ 



q;i 



fl-l 



I _.' 



;max#ofint servers 






rf 



r\ 



I*- 



I I * 



.r 



sta ihchaiRty ;put nops in 



i- 



1200 

1210 

1220 ihl 

1230 

1240 

1250; 

1260 

1270 

1280 

1290 , 

1300 

1310 

1320 

1330 

1340; 

1350 

1360 

1370 

1380 

1390 

1400; 

1410 

1420; 

1430: 

1440 killhdlr = * 

1450 ; restore irqs as before insthdir 

1460 php 

1470 sei 



■t 



dey 

bpl ihl^ ■ 

't 

php 
sei 

Ida $0314 

sta intexit + 1 

sta saveirq 

Ida $0315 

sta intexit + 2 

sta saveirq + 1 



jhandier chain 



r*- 



\- h. 



*- t 



k '■ ^ 



;save irq vector 



/". 



i_ 



I 1^ 



A 



Ida #<handler ■" ^ 

sta $031 4 ;point vector to handler 

Ida #>handler 

sta $0315 

pip 



rts 



- ^ 



1' ' 



,, r;t 



The Transactor 



January 1986; Vblume 8, luue 04 



AJ 
GF 
AL 
CK 
EL 
GO 
KH 
El 
BM 
PM 
EG 
KD 
GF 
AM 
MA 
HP 
ON 
GM 
JA 
MP 
JM 
EP 
BP 
EG 
OM 
NH 
HI 
BJ 
HJ 
08 
LB 
HA 
CB 
JD 
CD 
Hi 
PB 
MJ 
EO 
KD 
OM 
IN 
EC 
Nl 
NH 
JC 
ME 
HD 
OB 
10 
HK 
JH 
EA 
NL 
HA 
KL 
PD 
AD 
NG 



T 



saveirq 

$0314 ; restore irq vector 

saveirq + 1 

$0315 



tempvec 
tempvec+1 



Ida 
Idy 
Idx 



1480 - Ida 

1490 ■■■" ' sta 

1500 • Ida 

1510 sta 

1520 ' ■' -■ pip 

1530 '' ■ rts 

1540; 

1550; ■ .■■■■• .. 

1 560 addsrvr - * 

1 570 ; adds routine at address .a/.y 

1 580 ; to ttie interrupt chain; 

1 590 ; returns the number of the 

1 600 ; server in the chain in .x 

1610; 

1620 php 

1630 sei 

1640; 

1650 sta 

1 660 sty 

1670; 

1680 

1690 

1700 ■ 

1710ais1 

1720 

1730 

1740 

1750 

1760 

1770 

1780 

1790 a is2 

1800 

1810, 

1820 

1 830 sta 

1840 Ida 

1 850 sta 

1860ais3 pip 

1870 i-ts 

1880; 

1890; 

lOOOremsrvr = * 

1910 ; removes the interrupt server 

1920 ; specified in .x 

1930 ; from the interrupt chain 



I .- 



?(V<'i, 



"rr' 



; -T r^'rr- .. 



#$20 ;jsr 

#chainlen-3 

#3 
cmp ihchain,y ;skip full siots 
bne ais2 
dey 
dey 
dey 
dex 

bpl aisi 
bmi aisS 
sta ihchain,y 
put handler call in next 
available slot 

Ida tempvec 

ihchain + 1,y 

tempvec+1 

ihchain + 2,y 



1940 

1950 

1960; 

1970 

1980 

1990 risi 

2000 

2010 

2020 

2030 ris2 

2040 

2050 

2060 



[- 



php 
sei 

cic 

Ida #0 

dex 

bmi ris2 

adc #3 

bne risi 

tay 

Ida #$ea 

sta ihchain,y 

sta thchain + 1 ,y 



I 



;nopQutjsr to server 



IN 
EO 
GB 
KK 
EL 
EM 
BH 
MK 
PI 
BE 
AP 
ME 
NK 



2070 
2080 
2090 
2100 
2110 
2120 
2130 
2140 
2150 
2160 
2170 
2180 
2190 



sta ihchain-f2,y 

-■on-: pIp - . - 

rts 



handler = * 

jsr ihchain ;execute servers 
intexit = * 

jmp $ea31 
;($ea31 modified by insthdir) 

saveirq * = *+2 

;original irq vector is saved here 



Auto-Linefeed Generation 



7_ r 



Joseph Buckley 
Quincy, MA 



Page 349 of the Commodore 64 Programmer's Reference Guide 
states that opening an RS-232 channel with a logical file 
number of greater than 127 forces an automatic linefeed after 
each carriage return. What may not be commonly known is thai 
this only works when sending to the file using PRINT from 
BASIC. 1 came across this while using a printer that needed 
linefeeds. 

What I finally did was place a short wedge in the CHROUT 
routine. I changed the vector IBASOUT at $0326 to point to this 
code, 

wedge cmp#$Od 

bne skip 

jsr $flca ' 

Ida #$0a ' " '\ 

jrnp $f1ca 



skip 



', .1, 



This will add a linefeed after every carriage return printed. For a 
more general routine, you could limit it to device number two. 



Easy User- Alert 



Tom Morrow^ Oak Park, IL 



Often in a program it becomes necessary to signal to the user 
that something important is happening (like they are about to 
format a disk, or exit the program without saving work). The 
following short machine language routine performs this function 
quite economically. Include these lines at the beginning of your 
program; ■ . ^ 

10 data 172. 32,208,202,142, 32,208,165 

20data198,240, 248, 140, 32,208, 96 

30 for ct = 679 to 693; read dt: poke ct,dt: next ct . 

I . hi 

When you want to alert the user, just SYS 679. A pattern will 
form in the border of the screen until the user presses a key. 
After the keypress, the border will revert to its original colour. 



f - r 



A usage example: ' '■'■'"■'i 



.1 



10 print 'do you really want to exit? (y/n)' 
20sys679: getan$ 



I'. 



\u- r. 



.^■■;- 



^^■ 



Th«Traniactor 



8 



January 1938: Volume 8, Issue 04 



■r^. <!. 



C128Bits 



"^ - ^/r . ,w ir* 1571 Seek-Stopper 



SO-Column Tricks 



Kevin Hisel 
Champaign, IL 



, 1 



t stumbled across the following tricks with the VDC chip in the 
CI28. Use them in 80-column mode while in BASIC BANK 15, 

4 

10 rem wild screen roundup 

20 for i = 6 to 80: sys 52684 j, 1 : next 

10 rem character swipe 

20 for i = to 8; sys 52684,1,23 

30forx=1 to 100: nextxj 

1 rem open the curtain 

20 for i = to 100: sys 52684,1,35 

30forx=1 to 10: nextxj 



Simple Rules for the 1 28 



Kevin Hisel 



Being the librarian for a user group, I come across lots of 128 
public domain programs. Almost always, these programs need 
lo be slightly modified because the programmer did not follow a 
few simple and courteous rules. Here they are: 

Rule *1; Always place a REM in the first few lines that states 
what machine the program runs on. Many frustrated 64 owners 
may get hold of your program and wonder for days why it won't 
run. 

Rule ^2: Always check to see what screen {40 or 80 column) 
the user is running with and if necessary, adjust your program or 
simply display a message telling the user to switch modes. It is 
very easy: 

if fwindow(2) = 80 then prinffor 40 column mode only": end 

This can save a lot of head-scratching when someone tries to 
RUN your latest 40 column hi-res demo or 80 column spread- 
sheet, etc. 

Rule *3: If your program redefines the function keys, save the 
user's keys first, and when the program ends, put them back! 
Again this is very easy to do: 

To save the keys: 

for i = 4096 to 4352: poke i + 2048,peek(i): next 
To put them back when you are done: 

for 1 = 4096 to 4352: poke i,peek(i-+-2048): next 



A h 



These two operations take a few seconds to execute, but the user 
will be grateful that when they hit the F3 key for a directory next 
time, they won't format the disk or some such thing. 



Gerald Boersma 
Nepean, Ontario 



On the C-I28 with the 1571 disk drive, the drive does a lot of 
seeking on power-up if the disk within is single sided. In an 
earlier column, a reader mentioned that a solution is to copy all 
files to another disk, format the disk as double sided, and copy 
the files back again. However, there is an easier way! You can 
just format the second side of the disk while leaving side one 



alone. 



Type: 



- 1 



■Ai f ^'i'-' 



iiVry-i- ' >:' '.I . Lr- -[ "'^■- A- 



^f 



Open 15,8,15,"uO>mO' 
print#15,"uO>hr. 



-i ■ 



This puts the 1571 drive in 1541 mode, then selects the second 
read/write head. At this point the drive error light may flash, 
since the second side of the disk is not formatted. Don't worry 
about it; you are about to format this side: ^ 

^ 

prjnt#15."n0:anti-knock.ak" 

I , ■ ' I ' 

After the format takes place, the disk is prepared for future use. 
Now, when you boot up with that disk in the drive, the 1571 will 
immediately find both sides and won't chatter at you while it 
tries to make sense of the second side. 

CAUTION: Don't use this on "flippies", disks that have data on 
both sides, since you will wipe out the second side. 



C128 ]/0 Incompatibility 



Richard Thornton 
Richmond, Virginia 



Recently I spent considerable time trying to convert a C64 
machine language program to the C128. On the 1 28 version, the 
disk file it produced was incorrect, and some data was erratically 
written to the screen rather than the file. The problem turned 
out to be consecutive calls to the CHKOUT routine with no prior 
call to CLRCHN. Apparently the C64/1 541 has no problem with 
this, but the C128/1571 can't handle it properly Preceding each 
CHKIN and CHKOUT with a call to CLRCHN solved the prob- 
lem, ,. :JI .■ 



Function Key Finagler 



Ed Schmahl 
Bowie MD 



Here is a way to make your C-1 28 function keys self- modifying, 
so that every time you hit a function key, numbers within the 
key definition will increase or decrease by a set value. This is 
useful, for example, when you are developing a program and 
wish to save it with a new version number each time. With 
"function key finagler", you could set up a function key like this: 

4 

keyS/dsave- + chr$(34) + "file.OOr 
+ chr$(34) + ■:sys4864.5,1,2' 



I I f 



The first time you press F5. the file "file.OOr will be saved; the 
next time, the name will be ■fiie.002', etc. 



The Transactor 



Jonuafy 1986: Vblume 8, l»ue 04 



The "sys4864" in the above example is what incremenls (he 
value in the function key. You can put the routine anywhere in 
memory; it's fully relocatable. The syntax for using it is: 

' ■■ SYSad,a,x,y ' '•' 



Cursor Save and Restore 



I ^. 



ad is the start address of the routine (4864 in the above 
example); a is the function key number (1 to 10); x is the amount 
of the increment (which can be negative using 255 for -1 , 254 for 
-2, etc); and y is the position within the function key definition, 
with zero being the position of the first occurence of a digit. 

I 

Here are a few other self-modifying function keys that you 
might find interesting: 

key1,"graphic(0and1):sys4864,1,1,0' + chr$(13) 

(toggles graphics modes) 



Paul Blair 
Canberra, Australia 



This routine is one I've always wanted, and the C128 makes it 
easy. There I am. wanting to print something on the screen, 
jump off to another spot to print something else, then return to 
where I left off, to print more. 



n 



1 1 



Basic 7 has two routines to help me do this, SAVEPOS and 
RSTRPOS at $CC1E and $C932 respectively, SAVEPOS saves 
the current cursor location (column and row) at $DE/$DF. 
[RSTRPOS recovers them and puts you back whence you came, 
Trythis(frombankl5): 



h i 



I ^ 



1 scnclr: char 0,4,7, this is up here" 

2 sys 52254: sleep 2: char 0,1 1 ,20;iook!" 
3sys51506: sleep 2: print 'again" 



key2;vol5:sound2,4000,6:sys4864,2,3,ir + chr$(13) 

(beep with varying pitch) 

key3,"a=(00and15)+1:color4,a:sys4864,3,1,1" + chr$(13) 

(change border colour) 



Amiga Bits 



"'■'Z-ii'. 



CUHint 



Steve Tibbett 
Gloucester, Ontario 



key7;iist00000-00100:sys4864,7J,2 

;sys4864,7.1,8' + chr$(13) 

{list forward one block at a time) 

key8;iist00800-00900:sys4864,8,255,2 
:sys4864,8,255,8" + chr$(13) 
(list one block at a time backwards) 

Change these key commands to suit your taste, or invent other 
ones as you like. Remember to insert enough leading digits to 
prevent wrap-arounds in the numbers. The ML program is only 
80 bytes, so you can stuff it almost anywhere - even in the 
upper part of key memory {$1000-$! Off), if your key messages 
are short. 



Here's a tip I find useful at times for starting a bunch of tasks 
without stuff going on while Tm typing: If you hold down the 
CTRL key when you hit RETURN after typing a CLl command, 
the CLl will not start processing that line until you hit the 
RETURN key alone. So, if you type LIST <CTRL-RETURN> 

DIR <RETURN>, LIST will only be executed after the final 
RETURN, followed by DIR. 

This can come in handy when you want execute a few com- 
mands, but wish to wait until a large program has loaded to 
avoid making the disk head seek back and forth between files; 
while the program is loading, you can type all your commands 
using CTRL-RETURN between them, then just press the final 
RETURN when disk activity stops. 



Nl 
EM 
AF 
BD 
CO 
KA 
BO 
JJ 
GL 
CG 
FB 
NM 
PF 
FP 
OF 
CC 



CI 28 Function Key Finagler 

1 00 rem function key f inagler 
1 1 ad = 4864: rem relocatable 
120fori = 0to79: read n 
130pokead + i,n: ck = ck + n: next 
1 40 if ckO1 1 227 then prinfdata error" 
150: 

160dala132, 250, 168, 169, 16,133, 
170 data 0,133,251,136, 24,136, 
1 80 data 1 1 3, 251 , 208, 249, 1 05, 9, 
190 data 200, 56,177,251,233, 48, 
200 data 144, 6, 230, 251 , 208, 244, 
210 data 164, 250, 138, 113, 251, 176, 
220 data 58,144, 26,233, 10,145, 
230data 48, 21,169, 0,240,237, 
240dala176, 11,105, 10,145,251, 
250 data 6, 1 69, 255, 48, 222, 1 45, 



252,169 
48, 4 
133,251 
201, 10 
240, 39 
15,201 
251, 136 
201, 48 
136, 48 
251, 96 



AmigaDOS Rollodex Tool 



Benjamin Dobkin 
Rego Park, NY 



This short Execute file will retrieve all the "rollodex cards", from 
a properly formatted file, whose first line matches a supplied 
argument. 

For example, to find "Jones" in your database file called "ad- 
dresses", you would type from the CLl: 

execute rollodex Jones addresses 

All entries wliose first line started with "Jones" would be 
completely printed out. 

The '*rol!odex" execute file is simply this: 



- i: 



The Transactor 



10 



Jonuory 198B: Vblume 8, Issue 04 



.KEY string, database 

echo >ram:temp ■0{F BU/<string>/:P;TN);STOP" . 
edit from <database> to nil: with ram:temp OPT P6W60 
delete >nil: ram:temp 



It uses the line editor Edit (included on the standard Work- 
bench disk), so that program must be in your C directory or 
somewhere else in the search path for Rollodex to work. 
Your ''database" is just a standard ASCII file that you can 
make with a text editor (Ed, Emacs, etc.), with each entry 
taking a fixed number of lines, for example; 



> 



■ 

Jones, Fred 
1 8 Beazly Street 
London, England 
phone 21 2-304-31 23 



Jane, Mary 
14 41 St St. 
New York, NY 
phone 501-123-4351 



in a file like this, each record is six lines long. This corresponds 
to the first 6 in the '^OPT P6W60" option given to Edit in the 
execute file. You can change this to suit your needs. 

Rollodex works by giving commands to Edit. It creates a tempo- 
rary command file for Edit in RAM: that looks like this, with the 
ai^ument <s(ring> substituted for your search string: 

•0(F BU/<string>/;P;TN);STOP" 

This means go forward, look at the beginning of each line for the 
uppercase siring, when it's found, back up to the previous line, 
then type to the end of the buffer The brackets group these 
instructions together^ and the in front means repeat them 
indefinitely, until end of file. The STOP exits Edit and returns to 
theCU. 

Edit is then called, using the command file just created and the 
options P6W60, giving the buffer size (six lines of up to sixty 
characters each). As explained above, you can change the buffer 
length to suit your database file format- 
Note that in the database file, the search string must start with 
an uppercase character and must begin in the first column. 
Also, the match is made by the first characters on the line, so 
searching for ^"SM" will match ''Smith", "Smurf". "Smedley". 

etc. The " " used above is not necessary, but some form of 

delimiter between entries is a good idea for clarity- 

Now you have a simple database, without spending money or 
typing in a long prc^ram! 



AmigaBasic Fade-in Graham Reed 

- , . Toronto, Ontario 

i l- ■ . .-i , 

This simple AmigaBASIC program will create a "fade-in" or 
"fade-out" effect by varying the intensities of all four colour 
registers from the given colours to black, or from black to the 
given colours- It currently does the first four colour registers 
only, but it could be easily modified to work with 8, 1 6, or 32- 
colour screens as well, although a visible "wash" would occur 
due to the speed of Basic. 

I 

The fade is accomplished by the subprogram fadein. which is 
passed arrays containing the the red, green, and blue colour 
intensities (from to 1) for each of the four colours in the 
Workbench screen, and a fade direction- If the direction is 
nonzero, the routine fades the screen in from black to the 
specified colours; if zero, it fades out from the given colours to 
black. 

b 

The mainline part of the program shows how to use fadein: it 
loads colour values (specified here in their "real" form from to 
15 and converted to Basic's to 1 representation) imo arrays, 
and passes those arrays to fadein along with a direction. To show 
off, it keeps fading in and out until you click the left mouse 
button. ,; 

M 
X I 

. I h I ■ 

' fade in/out r ■ ■ ■ ,■,..'■. 

main: 
DIM r(3), g{3), b(3) - - ■' ■ ■ " 

FOR i =0 TO 3 'read rgb values for each colour register 
READr, g, b ■' ■-: ■ - ■ .. - 

r{i) = r/15;g(i) = g/15:b(i) = b/15 
NEXTi ■ . ■ r - 

PRINT "Click left mouse button to end' 
WHILE MOUSE(0) = 
CALLfadein(r{),g(), b(),0) 
CALLfadein(r(),g(), b{), 1) 
WEND 
END 

I 

' r. g, b values for eacfi colour register 
DATA 0, 5,10 
DATA 15, 15,15 
DATA 0, 0, 2 
DATA 15, 8, ; 

SUBfadein( red(1), green{1), blue(1), dir%) STATIC 
IFdir%THEN ■■ ■ 

dir% = 1 : st = 0: en = 1 'fade in 
ELSE , ■ - - 

dtr% = -1 : St = 1 : en = 'fade out 

END IF 

FOR i = St TO en STEP dir% * .0625 
FORj%=0TO3 
PALETTE j%, iTed(i%), \'greenijo/o). i*blue{j%) 
NEXTj% 
NEXT i 
END SUB 



^ J'l _ 



- f 



■■..■. p*V f*i 4 



^e Transactor 



11 



Januarv 1986: Volume 8, Issue 04 




H? 



e 



' -^r ' m'i i ' 



" 



T 



i .'-. 



■^ ... 

1 ■ 1 ■ . 


1 ' 

■ 


t 



- ^ 



>, I ,/■,, -1 



^fc_ 



1-^ V 



e 



Fht 



' ::: ^Mi^-.-i' 



't 



■', fii 




-,-■ ii?lbt"^ 



s 



"Advertising In The Transactor WORKSr': In your July 87 
issue of the Transactor you published my press release in your 
NEWS BRK section. Immediately following publication we experi- 
enced a dramatic increase in BBS sales from customers both in 
Canada and the previously untapped U.S. market- 

I would like to thank you for providing this wonderful service. 
Without help of this kind, small mail-order operations, like myself, 

would not survive. Pass the message to your prospective adver- 
tisers; advertising in the Transactor WORKS! 

James MacFarlane. Co-Author, Spence XP BBS 

[slington, Ontario. Canada 



CP/M In The T: Thank goodness, somebody realises thai CP/M 
articles are NEEDED. I have the C128. can't afford to buy an Amiga 
- and if I could my wife wouldn't stand for spending that much 
money on my hobby - so I have to explore all facets of the computer 
! have! I have dropped my subscriptions to Compute Gazette and 
RUN because they never publish articles on the CP/M mode. 

Please encourage Adam Hearst and Clifton Karnes to keep writing . 
. , for your CP/M audience. 

J. Nelson William, San Diego, California 

At first we stayed away from CP/M because of its age; the duration 
of its existence fed us to believe that there was already plenty of 
information available in other magazines and books. Turned out we 
were wrong - CP/M info has gone dry, and help can be hard to 
find. So we began actively look for a little CP/M material each issue. 
Thanks to Adam Herst. Clifton Karnes, Aubrey Stanley, Mike 
Garamszeghy and others, CP/M is shedding its years and looking 
good. Thanks for the support. . . . 



". . .if I owned one I would get an Amiga magazine!": Mr. 

Bernard H. Weiss (Letters, Volume 8, Issue 2} has expressed what 
has been on my mind for some lime in regards to your Amiga 
coverage. There's too much of it! 



My 64 has done the job for me for 4 years and so has the 1541 
(without trouble!)- The Amiga is a great computer but if 1 owned one 
I would get an Amiga magazine. Computing is a hobby with me. but 
if I were to get on the treadmill of buying a new machines every 
year or so I could not afford the Transactor! 

P.S. I do not like your Volume 8, Issue 3 cover! The old artwork was 
worth the price of the "T" by itself. Also, the paper is too shiny - 

hardon theeyes!!! 

Hans Uechert, Wymark, Saskatchewan 

Commodore has produced some pretty good computers over the 
years. And since 1978, we have covered them all, in one way or 
another. The Amiga is yet anotfjer Commodore computer, so we've 
covered it too. It's nice to work with, powerful and full of possibili- 
ties. But you 're right - Amiga users should buy an Amiga-specific 
magazine. Tfiat^s why, come early January, Transactor wilt un- 
dergo mitosis. You'll get your eight-bit journal once again. No more 
Amiga coveragel This cell-division, though, will spawn a second 
Transactor for Amiga users only - "Transactor for the Amiga". 
(Note to Amiga users looking for more details: see the editorial in 
this issue.) 

You don 't like our CN Tower photograph! John Mostacci would be 
glad to hear that you miss htm. But the new cover design is here to 
stay - at least till the next time we change it. After painstaking 
market research, we have determined tfiat white magazine covers 
show up belter on a newsstand shelf that coloured ones do (actually, 
we just went to a magazine store and had a good look around, but it 
amounts to the same thing). Luckily for us. a lot of readers seem to 
approve of the new covers, though we have to admit there's quite a 
few disgruntled Duke fans out there^ But what could we do? Duke 
got himself an AT clone, and he 11 probably show up In one of the 
MS-DOS magazines any month now. reviewing productivity soft- 
ware. 



Program Listings For All Macliines: Your last news stand issue 
was the first issue I ever saw of the Transactor. I regret the past 



The ^anaoctor 



12 



January 1986: Volume 6, Issue 04 



issues I missed, but I will be pari of the future. Since my greatest 
pleasure is writing my own programs, your instructiona! listings in 
hexorBasiciswliatlamiookingfor. ■'■' '* - ' ■ ^^ 



• I. 



--•^■ 



I do have a request {that you must get all the time from owners of the 
CI 28). When my current program ran out of string space (especially 
variable space). 1 upgraded from the C64 to the CI 28, 1 noticed most 
of your articles deal with the C64. I suppose the philosophy in 
computerland is that since we have a C64 in our CI 28 we are 
covered. However, I bet that most of your readers are also hackers 
like myself and once we have put our programs into CI 28 format, 
we can't go back to the C64, For instance, "XREF for the 64'^ by 
David Archibald makes my mouth water. 1 could really use that help 
with my program. Since it is written with data statements 1 can't 
change it for my CI 28. My request is that you might make it a policy 
that any C64 article you print would be purchased (of course at a 
lower fee) in revised CI28 format if anyone in your reading 
audience has the ability or patience to do so. Inoticed that Compute! 
Magazine often lists the same prc^ram for several different com- 
puters. Maybe this means fewer pr(^rams per issue, but nobody is 
left biting their finger nails (except C128 owners in Compute! 
magazine). 

P.S. [t would also make purchasing your disks more reasonable. At 
this point it would be just another frustration. 

Cynthia Darrow. Waterlown, NY 

That's an interesting idea. Cynlhio. In fad, whenever possible, we 
do iike to run multiple versions of our published programs. Also, we 
usually are able to pubUsh the source for machine language pro-^ 
grams (though not in the case ofXREF, unfortunately.'); we do this 
for the very reason that it enables readers to modify the code to suit 
their own needs or their own machines. If readers wish to send us 
ported versions of programs from the magazine, we will certainly 
consider them for publication for perhaps for the disk, depending on 
the size of the program, and so on). In any cose, good ideas don V 
Just materialize once then vanish, so you 'fl more than likely see an 
original CI 28 cross-reference program In Transactor some time in 
the near future. 



IVansactor Continuing Education Course: In the course of a 
long and varied academic career, now defunct by a good ten years, 
it has been my lot to deal with Continuing Education courses offered 
by our University - in fact, I still operate several of fhem in the field 
of Microbiology and Public Health- 

As a result of this experience and the fact that it seems unduly 
torturous to learn 6502 assembly language in any short time, solo, it 
occurs to me that, given a sufficiently lar^e, interested body of eager 
neophytes, you and your considerable bevy of top-notch experts 
could either offer such a course by mail for an appropriate fee, or it 
could be activated as a continuing series in Transactor, my all time 
favourite mag. 

One might suppose that you have thought through such a plan 
many times and discarded it for any niimber of arcane reasons. 
Even if so, perhaps another look might produce different results. 

Bob Tischer, aarkville, MS 

Bob. we have never considered providing a course through the mail 
before. With our small staff it's difficult enough to Just keep 



producing the magazine. You could be right, though. If sufficient 
interest did materialize, I am sure we could round up a host oftop- 
nome authors to give us a hand with the series. Food for thought. 
Maybe your letter will generate some mall for us. How about it folks 
- Continuing Education, by mail, in intermediate to advanced 

programming skills? Comments, anyone? 

... . ., . ■- -,^ ■ 'I ''» ''^ y.^iin\vi '.I 

"GEOS mice-and-Iittle-ptctures envlronraent": GEOS 
doesnH seem to get much respect among ''techie" users. While I can 
understand that. \ have noticed that it's oflen the people who are 
most enamored of the Amiga mice-and- little- pictures environment 
who sneer the most at the GEOS mice-and- little-pictures environ- 
ment. Since the T is the foremost in Commodore techie magazines, 
I'd be most interested in seeing a few articles about GEOS. pro or 
con (and I'm aware that the "pro" ones will be hard to come by!) 
Any possibility of that? 

Marte Brengie, Burbank, California 

GEOS. Its been a tough decision to make since day one. GEOS is 
great for those users who find it suits their style, but so for It doesn T 
seem to have been inspiring for many programmers. If we 're going 
to cover GEOS, it will be from the programmer's point of view - our 
normal slant, in other words. So far, we haven > been getting those 
articles and, frankly, we wouldn't know where to look for them 
outside the wails of Berkeley Saltworks. And so, we're silent on 
GEOS... not from principle, but for lack of mater iai Sorry Marte. 

Commodore 1526 Blues: I am one of the poor people who 
bought a Commodore 1526/MPS 802 printer. 1 say poor, although I 
have been quite pleased with it as far as it goes. The major 
drawback with it (as you probably well know) is its very, very 
limited graphics capability, I have often thought that, given its 
reputation as a "smart'" Commodore peripheral, it should be possi- 
ble to create a new ROM chip for it which would make it work like 
am MPS 801 (1 525). I would be interested in doing it myself except 
that my skills are all in software with only limited skills in the 
practical aspects of firmware and hardware. I'm afraid of frying my 
printer, computer and every other solid state electronic device in my 
house if 1 do anything more than take a chip or board out and put 
another in. Do you or any of your readers know of any companies or 
individuals who have done such a public service? Given that the 
printer seems to be modeled after the Mannesman Tally Spirit 80, 1 
should think that it is quite possible. I believe that the Spirit 80 has 
graphics capability. In a similar vein, have you heard of interfaces 
that allow Commodore printers to be attached to other computers 
(e.g. you-know-who and compatibles) or are the CBM printers just 
too smart for that kind of dumb hookup? 

Peter Chynowelh. Saskatoon. Saskatchewan 

Prepare for a feast. Within the next few months, if things continue to 
go welt, a new series of hardware modification kits will become 
available through transactor for the I526printer. Themodsarein 
three stages. First, a change of ROMs that will clean up all existing 
1526 bugs, increase the printing speed, and also provide a whole 
new set of commands through a printer command channel. These 
commands include a way to tell the 1526 to emulate a 1525 printer 
flawlessly! Until the code Is complete, I can Y go any further on the 
command set. •' ■ ^"'- 



_i 



The second mod kit provides a circuit board containing a new 
microprocessor and IK of RAM that will replace the I526's normal 



Th« Transactor 



13 



Jonuary 1968: Volume 8, Issue 04 



processor. The purpose: to of low the 1526 to access more memory 
through a better chip, thereby allowing fonts to be downloaded into 
the additional RAM. The third mod kit contains a panel of switches 
to be mounted on the 1526. These switches will allow control of 
Top-Of-Form, On & Off-Line and whatever else can be thought of. 
Just be patient for a little while longer - the way it looks right now. 
the answer to your 1526 woes is right around the corner 



J riT 



Using An IEEE Disk Drive With The Commodore 64: 1 have 
always felt thai it would be a real asset to have a dual disk drive. I 
was disappointed when 1 learned that the manufacturer of the 
MSD-2 was no longer in business. However, 1 was attracted by an 
advertisement for interfacing a Commodore 4040 dual disk drive 
with the C64 by using an RTC C64-UNK 11. This interface also 
raised the BASIC 2.0 to 4.0 {16 additional disk commands). 

1 have had continuous problems with this arrangement. The 
BACKUP and COPY commands do not work if there is any kind of 
glitch on the source disk. Many programs such as PRINTSHOP and 
NEWSROOM wil not load from the 4040. By typing in SERIAL, I am 
able to default the system to the 1541 drive and thus load the 
programs, I do not regard this as being a satisfactory arrangement 
as the very reasons for acquiring a dual disk drive have been 
defeated. It would appear that there are inherent differences be- 
tween the two drives but it escapes my logic as to why. 1 do know 
that a large number of programs can be loaded from both disk 
drives and formatted disks from either drive are compatible. Have 
any of your readers encountered this problem and, if so. have they 
been able to solve it? 1 have already invested considerable time and 
money in this system and would hate to abandon it now. Any help 
you can offer would be appreciated. ] 

If a program uses disk protection or direct disk programming 
techniques, it should be stated on the label in BOLD PRINT. But it 
never is. if a program has been written that requires the 154J to 
operate, such as Printshop or Newsroom, then chances are that you 
cannot use another drive in its place. Advanced programming 
techniques that exploit internal features of the 1541 disk drive 
cannot possibly be expected to work on any other disk drive. The 
1541 and the 4040 differ in the amouiU of RAM they contain, the 
usage of that RAM, the code contained in ROM. plus the way in 
which the drives handle data. The 4040 is an IEEE-488 parallel 
drive. The 154! is a pseudo-serial drive. By looking through the 
source code for each, similarities and differences abound. They 
share lineage, but are not the same drives. Enough said. 

The 4040 drive was never meant to be a bit copier. If an error was 
encountered during a Backup or Copy, then the procedure would 
bomb out every time. The RTC Link cannot be expected to improve 
on the drive. One problem inherent with the RTC Link, though, was 
its consumption of RAM. In order for it to provide you with an IEEE- 
488 interface plus give those '16 additional disk commands", some 
liberties were taken. Incompatibility with some commercial pro- 
grams will be found. 

We have been using the entire line of IEEE-488 drives with our 64s 
for years. Karl right now has a 4040 and an 8250 plus several 
8050s, all hooked together over our G-Link IEEE'-488 interface for 
the 64. A Ithough you don 't get any extra commands, it does provide 
clean and fast access to the IEEE-488 bus. It's an ugly interface, but 
it works. ^ -,- 



One last point before going on. MSD did not go out of business. They 
simply stopped supporting the Commodore marketplace. This ru- 
mour has been spreading for quite some time, and it's time that it 
stopped. The president of MSD called us about it one day after he 
read a somewhat exaggerated account of his company 's demise in 
our NEWS BRK section. Needless to say, MSD is alive, well, and 
staying far away from the Commodore community. 



'■-,._ 



*ii A\f\- l> 



Macro Assembler l>e»lred: I am at my wits' end in dealing with 
my Commodore Macro Assembler package. I am fine until 1 attempt 
to assemble a macro. When the macro is expanded, the assembler 
gives me an error Give me the names of a few good macro 
assemblers (make sure they include excellent documentation). I 
noticed that Transactor uses PAL i am unfamiliar with PAL Is it a 
MACRO assembler? Where can 1 gel it? Any help that you can give 
me to get me started on the road to machine language proficiency 
would be greatly appreciated. - - 



i II 



i h 



JeffryS. Barnes, Clarksville, IN, USA 



1^ 



PAL is not a macro assembler. It is just a nice 6502 assembler to use 
with the PET/CBM, BI28 and C64 microcomputers. Currently it is 
being marketed by Spinnaker in the US under the '^Better Working 
Software" label, along with POWER 64, as 'The Programmers' 
Toolbox". Together, PAL and POWER make a terrific buy at any 
price. I'll provide Spinnaker's address, plus Spinnaker's Canadian 
distributor's address and such at the end of this reply. 



V h 



The finest 6502 macro assembler that I have used to date is the 
POWER Assembler (aka Buddy 1 28 and Buddy 64), also distributed 
by Spinnaker. Buddy was written by Chris Miller, a name that will 
be familiar to many of our readers. Chris has been regularly writing 
for us for years. A few issues ago we published Chris' ^'Mr. Ed", a 
text-editor for the C64. You 'II find a full-blown version of Mr. Ed on 
either Buddy disk. This text editor is part of the version of Buddy 
(EBUD) that will assemble text data files in RAM. You 11 also find a 
version of Buddy (BUD) that will assembler PAL-lype source files 
(i.e. Basic source), and a final version for CI28 users that will 
assemble Z80 code on the C128 side. To make this package even 
better, Chris tossed on a slew of macro source files, extra utilities 
and whatever else he could think of It was a true labour of love. 
And it is not copy-protected in the least. 

The documentation is good. But that was to be expected consider- 
ing that Chris Miller wrote the docs. The manual is informative, well 
laid out, and fun when the going gets tough. In short, he did a good 
job. Since the first time Chris sent me a copy, I haue been passing it 
about to people that I knew would use if and advise Chris on how to 
make it better. Liz Deal, Mike Garamszeghy Aubrey Stanley and I 
hove caused Chris more than enough headaches, but to date, he 
has always come through. Buddy is perhaps the nicest and most 
versatile assembler that you'll find for the Commodore line of 
computers. 



US Distributor 

Spinnaker 

One Kendal Street 

Cambridge, MA, 02139 

(617)494-1200 

800-826-0706 toll-free 



Canadian Distributor 
Beamscope Canada Inc. 
1 10 Commander Blvd. 
Scarborough. Ontario, Canada 
M1S3H7^ (416)291-0000 
800-268-3521 toll-free (Ontario only) 
800-268-5535 toll-free (rest of Canada) 



_ 



The Transactor 



14 



Jantiory 1986; Volume 0, Issue 04 



Tranzbloopurz 



GAP HLL, Vol5, l8sue6, page 57 

This one goes back almost three years! Paul Blair of Holder, 
Australia, writes, ^'Could I point out a very minor bul important 
glitch in GAP FILL The problem is in line 230. If the order of file 
opening is reversed, the program runs quite happily on my 4040. 
So, I suggest line 230 should read: 

230 OPEN 5,8.5,"#";OPEN 15,8.15: REM etc 

If! don 't do this, the error light flashes, the drive gets hysterical, and 
the program gets knotted up. Not a pretty sight. 

Vve never worked out quite why this order of things is required. Rae 
West, in his opus magnus on PET programming, gives it both ways 
- as you had it on page 185 (the introduction to use of disk drives) 
then uses the reverse order in all the working exampies. There's 
obviously a reason, but I just don 't know what it is. Maybe someone 
else does." 



deas, anyone? 



Garbage Collector Revealed, Vol8, Issue2, page 30 

A problem that won't affect correct operation of the program, but an 
interesting one to look at. On lines 1140, 1150 and 1180 of the PAL 
source listing, the word "collect" in the comment field has been 
replaced by the word "input". This, as author Michael Graham quite 
correctly points out, is the result of tokenizing the source code on 
one machine, and listing i( on another. 

Inside View - bits, page 8 

It turns out that this program will not work on 64s that have ROM 
version 2, because it stores to display memory without modifying 
the corresponding colour memory. If you have an older 64 and find 
that the program behaves strangely, that's probably the reason. Our 
apolc^ies to anyone who typed it in and can't use it; unfortunately, 
it's not possible - and usually not necessary - for us to test 
everything on all ROM versions. 

C128 Programmer's Aid Fix - Letters, page 17 

i_ 

After stating that the new version of CI28 Programmers Aid would 
be fixed and put on Transactor Disk *20, we found that the code 
changes were responsible for not only fixing problems, but creating 
some new ones too. If we gel a good one working, we'll put it on a T 
disk and let you know. 

Switchable RS-232 Interface, page 21: 

The circuit diagram left out a few labels: the ICs, starting with the 
1488 and moving clockwise, should be labelled Ul thnDugh U5;the 
diodes at the upper left ot the diagram are, from top to bottom, Dl, 
D2 and D3; the capacitors just to the right of the diodes should be 
labelled CI and C2, again from top to bottom. Also, the IN4001 
diodes, as they are named in the diagram, are incorrectly referred to 



as INOOI in the parts list. Another problem with the diagram: the 
small note at the bottom saying to ground all unused pins on the 
1488 and 1489s is incorrect: only the 1488 should have its unused 
pins grounded; the unused pins on the 1 489s should be left as N/C - 
no connection- Finally, the voltage ratings for the disk capacitors in 
the parts list are not specified - the ratings are unimportant, and the 
lowest you can get will do. 



1 t 



Getting Around With Gogo Dancer, page 47: 

T 

There were a few small bugs in the Gogo Dancer program; here is 
the revised BASIC loader. This new version arrived at HQ about 2 
days after we went to press. Although the original works in most 
case, it will not process line labels and computed line numbers 
beyond a "THEN" statement. This new one does. The changes from 
the original listing are shown in boldface: ' 



DP 
EP 
GJ 
EJ 
HA 
PE 
OL 
AO 
GO 
JF 
BA 
KA 
LM 
PI 
KA 
IE 
BC 
HE 
EE 
DC 
PB 
BA 
JD 
IG 
EF 
HE 
CI 
KH 
EJ 
IK 
MK 
HA 
PF 
HI 
OJ 
MJ 
GA 
CD 



100 rem save'0:gogowedge.lclr',8 

1 1 rem •* written by cfiris miller, kitchener, Ontario 

120 rem ..-._,, 

130forj = 491521o49395:readx 
140 poke j,x : ch = ch + x : next 
150if chOSieiS then prinfchecksum error' : end 
1 60 rem 

170data169, 11,141, 8, 3,169,192,141 
180 data 9, 3, 96, 32,115, 0, 32, 20 
190data192, 76,174,167,201,139,240, 15 
200 data 201, 137,240, 77,201,141,240, 47 
201data201, 64,20B, 37, 76,248,166, 32 
203data115, 0, 32,158,173,165, 97,208 
205data 6, 32, 9,169, 76,251,168, 32 
207data121, 0,201,137,240, 43,169,167., 
209data 32,255,174,201,128,144, 37,176 
210data203, 32,124, 0, 76,237 
220 data 167, 169, 3, 32,251,163,165,123 
230 data 72,165,122, 72,165, 58, 72,165 
240data 57, 72,169,141, 72, 32,105,192 
250data 76,174,167, 32,115, 0,201, 64 
260 data 240, 12, 32,124, 0, 32,158,173 
270data 32,247,183, 76,163,168, 32, 6 
280data169, 136, 177, 122, 201, 36,208, 34 
290dala 32,115, 0, 32,139,176,160, 
300 data 177, 71,240, 91,133,255,200,177 
310data 71,170,200,177, 71.168,138,208 
320 data 1,136,202,134,253,132,254, 76 
330 data 178, 192, 132,255, 165,122,133,253 
340data165, 123, 133, 254, 165, 43,133, 95 
350 data 165, 44,133, 96,160, 4,166,255 
360data177, 95,201, 64,208, 25,136,136 
370 data 136, 177, 253, 200, 200, 200, 200, 209 
380 data 95, 208, 1 2, 202, 208, 240, 200, 1 77 

23,201, 58,240, 19,160 
95, 170,200,177, 95,133 
95, 177, 95,208,205, 76 
56, 76,197,168 



390 data 95,240, 
400 data 0,177, 
410 data 96, 134, 
420 data 227, 168, 



Adding Analog RGB Capability to the 1902 Monitor 



I I- 



Nothing wrong witti ttiis one, except that It might be a little hard to 
find using our Table of Coritents. It's on page 72. 



The Tronsoctor 



IS 



JanuaiY 1988: Volume B, Issue 04 



'■.t 



I r 



- >' I , ^ 



i] 1]'. ''■'<' 



t I I 



_'Lt- J 



-*. 



r^ ^u 



I >-ii . I I 



TeleColumn 



- . I 



::-^.^\ 



'1^ 



T I 



Transactor Online Conference i • ■ 

Saturday, November 21 at 10:00 PM Eastern (7:00 Pacific) 

in CompuServe's CBMCOM CO ,, . ,.. , ,^,., ,, 

An evening with 

Ben Dunnington and Mark Brown v 

of INFO Ma^zine 



!"*■''; 



1 ,1 



^'\i^ 



'I I 



.\ 



.11 , ' » ^ 



^^p.<' 



■■,' . 'I 



-■\ P -I 



.AJ 



■'* , Ji I /*r •• 



< I' 



1 



vr 



Online with Ben and Mark 

[f you're looking for info on a piece of Commodore related hardware or 
software, chances are good than Mark or Ben have it. I guess that's 
whay their magazine is called "INFO", and it's one of our favourites. 
INFO Is pressing near 200.000 copies per issue now and has worldwide 
distribution. 

INFO'S claim to fame is "the first personal computer magazine pro- 
duced entirely with personal computers". So if you're looking for some 
advice about desktop publishing, you'll want to talk to Ben and Mark - 

they've been at it since before the term was invented, 

'i 

Since we're starting an Amiga only publication, we're also looking 
forward to asking them ff they have any simitar plans of their own. 

So don^l miss out! Sign on (use 300 baud - it's cheaper) and enter GO 
CBMCOM, At the main Function prompt enter "CO" - we'll use the 
default CO channel. 

Doii*t Be Fooled 

The ads for GEnie circulating in the major mags compare Compu- 
Serve's $39.95 registration fee against their $18.00 fee to sign up. The 
$39-95 charge will indeed get you registered for using CompuServe, 
but that also includes manuals, a subscription to Online Today (Compu- 
Serve's own monthly magazine) and $25.00 of paid usage time. I'm not 
sure what GEnie throws in for the 1 8 bucks, just as I'm equally unsure 
what The Source gives you for their $49.95. All figures in US dough, 
tool 

However, CompuServe offers extensive online help at all prompts and 
for those with any telecomputing experience at all, the manuals quickly 
become unnecessary. 

Want to save 40 bucks and get something for nothing at the same time? 
There's another way to get a CompuServe membership. It's called a 
"CompuServe Intro Pak", The cost? Absolutely FREE! And it comes 
with a $ 1 5.00 time credit so you can try it out for a while to see if you 
like it. All you need is a credit card. 



VO 



w± 



. i 



1,1 



":► i.h*» 



- i 



Ml 



Just send us a self addressed envelope (please, no stamps - save them 
for Christmas cards). We'll turn it around with an Intro Pak inside {one 
per person please). When you get it, you'll notice there's a "snap pack" 
at the center of the booklet. Inside you'll find an account number and a 



password. At the back of the book are phone numbers for hundreds of 
CompuServe network nodes, as well as numbers for the other data 
carriers such as Tymnet and Telenet. The inside back cover will show 
how to get connected to the service after you've established a connec- 
tion with the node. • 

The "Host Name" is "CIS" - you may see this, probably not. Now enter 
your account number, hit RETURN, and follow with your password. 
CompuServe will notice that this is your first time on and ask you for a 
method of payment so have your credit card number handy. Cheque- 
Free is another payment method offered by CIS, but I believe this may 
require a validation period. Regardless, your first $15.00 of connect 
time is free - if you enter a credit card number you'll be sent straight 
into the system. 

About two weeks later, CompuServe will send you a new password. 
This is to protect against unauthorized use of your credit card - the new 
password goes to the address that belongs to your card number. To 
change your password again, enter GO PASSWORD at any prompt. 

Depending on the transmission speed you connect at, $15,00 will get 
you different amounts of free time. At 1200 bps, $15.00 will cover you 
for just over an hour; at 300 bps, $15 is good for about 272 hours (does 
not include Telenet, Tymnet or DataPac charges). Also in the back of 
the Intro Pak are access instructions for hundreds of forums within the 
system. Enter GO CBJ^PRG or GO CBMCOM, for example, and youHl 
have navigated your way directly to the forums managed by us at the T. 
On your first entry to the forums you'll be presented with the Visitor's 
Menu, but please select the "Join" option - there's no extra charge for 
this, and by joining you'll be allowed to f-eave messages and download 
programs from the Data Libraries. So Leave us a message - we check 
into the forums every day and we'll Ijave a reply out to you usually 
within 24 hours. - ... 

The same ads mentioned above show GEnie's connect time chaises to 
be less than The Source and CompuServe's. But remember, "you get 
what you pay for" and, based on reports I've received via Email, 
telecompuling services are no exception to this rule. Also, CompuServe 
is one of the oniy services with their own nationwide network. From 
most major metros, CIS is a local call and the network charge is 25 cents 
per hour. Most others can only be accessed using the independent data 
carriers, or by dialing long distance. Although Tymnet, Telenet and 
DataPac offer local numbers in most areas, using their services adds a 
surcharge that makes the basic hourly rate substantially higher. 



The Transactor 



_ 16 



- Th 



January 19M: Vbiume 8, Issue 04 



We've had several reviews published in recent issues by users of the 
major lelecomputing services, buf other opinions are always welcome. I 
don't think GEnie, BIX or PeopieLink have been in the TeleColumn 
spotlight yet - maybe someone who uses several services would be in a 
good position to write 'em up. . . someone that could be dragged away 
from his Amiga for an hour or so. . . someone like. . . Tim Grantham 
perhaps (hint, hint). 

Sunday Night COs with Nick Sullivan et al. 

Care to chat online? Perhaps you're looking for a program that isn't in 
the Data Libraries. Maybe you've just bought something new with 
features not explained very well in the manual. Or youVe been 
working on a program all weekend and you just can't seem to get past a 
stubborn bug, I could think of a hundred other reasons, but if any of 
them happen to coincide with Sunday night at 1 (or thereabouts), sign 
on. GO CBMPRG and enter the CO area. Nick Sullivan and any other 
sysops, assistant sysops, or just plain knowledgable types, will be 
making regular appearances in the conferencing area every Sunday at 
10. By the way, use 300 baud - it's cheaper and you can1 type at 120 
characters per second anyway. 

Attention Anchor 6480 Users 

Thought you bought a lemon, did you? Most 6480 owners Tve talked to 
have all but given up on the ''black sheep'' of modems for Commodore 
eQuipment. But there is hope. Word is that version M of AuloCom 
works pretty well. On CompuServe the C64 version has scrolling 
problems, but can be fixed by changing your terminal type to "CRT" in 
GO PROFILE, 

To get a copy, call Anchor Automation at (818) 997-6493. 

CBTerm Now Available in CBMCOM 



That beep, however, can really mess up an online connection, as many 
have found out the hard way. Just before the beep, there's usually a split 
second of silence that a modem would consider as "no connection" - 
the carrier is lost for just long enough to make the call disconnect. 
When it happens, about all you can do \s answer your second call. 

Recognizing this problem, most telephone services are now offering 
'*c all -waiting disable". By dialing "♦70", your call-wailing feature is 
temporarily disabled at the main switching station. You'li then hear a 
second dial tone, at which point you proceed with the number of the 
service you want to call. U you don't have touchtone, dialing 'i 170^' 
works the same way. If neither works, try calling your business office for 
an answer, and then please share it with us. 

On autodial Hayes and Hayes compatible modems, the command 
'WDT*70.555I2I2" usually works, where ''5551212" is, of course, 
the number of the service. If your modem doesn't accept the asterisk, 
use "ATDTI 170,5551212". The comma gives a two second pause to 
wait for the second dial tone before proceeding with the number. 



. 'T 



I've heard different reports on re-enabling your cail-wailing feature. In 
the U.S., it seems to vary depending on the company servicing your 
calls. Some say you must dial *70or 1170 tore-activate; others say it's 
automatically re-enabled when you hang up. In Canada it doesn't 
matter, because I can't get it to disable, let alone re-enable. When I 
called our local business office I was told there's no way to do what I'm 
describing, but again, the service may or may not be available in other 
areas - call the business office number on your phone bill to find oul for 
sure, ' ■ 

Mitey Mo PrograiDming Tips 

Before we log off, here's a technical tidbit taken from a reply by Gary 
Farmaner to a question about the Mitey Mo modem on CBMPRG: 



One of the most popular and most powerful terminal programs for the 
C64 is now available in the CBMCOM forum. CBTerm features include 
Xmodem protocol transfer capabilities with automatic Image header 
stripping for downloading programs uploaded to CompuServe with B 
protocol It has a software 80 column screen mode, with dual incoming 
and outgoing windows. There are dozens of support files and overlay 
modules available too, including an overlay to make CBTerm work with 
the Anchor 6480. 



The Mitey Mo, in addition to hook, uses lines of the user port to control 
the carrier tone and the answer/ originate mode. To make sure all the 
lines are set up properly, use POKE 56579.38. This is a universal poke; 
it works with every modem. ' ' 

With the Mitey Mo modem, you deal with the following lines by reading 
or changing the following bits in location 56577 (bit is LSB, bit 7 is 
MSB): 



Don't have a program that will download using Xmodem protocol? A 
catch-22 situation because without such a program, you can't download 
CBTerm so that you can use it to download other programs. Not to 
worry, mate. Sign on to CBMCOM and we'll direct you to a program 
called BXD - Boot Xmodem Download. This short little BASIC program 
is easy to type in and can be used just long enough to get a more 
comprehensive terminal emulator. . . like CBTerm! Once you have 
CBTerm you discard BXD and enjoy your full-featured access to one of 
the most comprehensive collection of programs available online or 
anywhere. 

CaU Waiting Disable 

Do you have call waiting? You know, that handy little telephone feature 
you pay extra for every month? It's great when you're on the phone a lot 
- when someone else calls, you hear a beep and put your first call on 
hold while you answer the second- ; - 



Hook 

Carrier 

Ring 

Tone 

Mode 



bits 
bit 4 
bit 3 
bii2 
bit! 



zero /on line 
zero/no carrier 
zero/ringing ■ 
zero /carrier tone 



one/ offline 

one/ carrier present 

one/ no ring 

one/ carrier tone off 



zero/answer mode one/originate mode 



tx ^ 



'■■ -M 



- c 



(For a BBS, you'll want to be in answer mode; callers will use originate.) 

■ ■ /^ ■- 

For answering a call, you'd do [tiG following: Wait for ring with bit 3; go 
online with bit 5; put on your carrier tone with bit 2, wait for carrier 
using bit 4, 

\{'s a good idea to count down a number of occurences of a ring-detect 
before registering it as a ring. The ring detect line will alternate 
between zero and one throughout a ring, at the ring frequency. 
Occasionally a single ring transition will occur without an actual ring, 
so counting off a few transitions before accepting will ensure reliable 
ring detection. 



•, ii- 



The Transactor 



17 



January 1998: Vblumo B, r»ue 04 



"J-Hj-I'Tn ^^l I ■ fr'_'f^l ^^4f*:iMfT. I iN*--v/Lh"' 



The Projector 
Partll 



1^ 



^ I 



■ r II ii 



u): !''■ '^::'yj 



-** 



1 'h .1 



jr 



l'.;r';;>f**' ..rr' ';''"■," -^"''.■^,-" 



Ian Adam 
Vancouver, BC 

Copyright © 1987 Ian Adam 



^ ' 1 + 



p -r--,\ ? J J 



. . . The most significant improvement is the treatment of hidden lines. . . 



I I 



. ^^iiy^ ' '" ^'^-1 -I"!!*.] "_'rxi ^ 4i't 



TT 



Part I of the Projector was published in Volume 6 Issue 4 of 
Transactor, ft produces a three-dimensional plot oi any mathemati- 
cal formula on the screen of the Commodore 64, using Gary Kiziak's 
High-Res graphics utility from Volume 5, I&sue 6. That program has 
now been improved through the addition of several new capabili- 
ties. It has also been extended to the new Commodore 128, 

Hidden Lines 

The most significant improvement to the routines is the treatment of 
hidden lines. The clarity of the plot is greatly enhanced by deleting 
lines that should be hidden from view by other parts of the subject. 
Achieving this required some modification to the original plotting 
routines, so you will have to obtain the revised machine code in 
order to see it in action on the 64- 

Conceptually, removing hidden lines is not difficult, if one makes 
some assumptions about the solid shape being plotted. In this case, 
we assume that the shape is an upward-facing surface that does not 
double back on itself; that is, there are no caves and the bottom 
surface, if any, is not visible. With this assumption, objects in the 
background are only visible if tfiey are taller than the foreground. 

To implement this theory a buffer of 320 bytes is reserved, each 
byte corresponding to one column of pixels on the screen. The 
algorithm uses the buffer to keep track of the highest point plotted 
so far. When the plot is first started, the buffer is cleared to all zeros. 
The plotting is then done from foreground to background. Each time 
a point is plotted, its height is compared to the appropriate byte in 
the buffer; if the point is higher than the value found, then the point 
is plotted and the buffer is updated by substituting the new height. If 
the current point is lower than the value in the buffer, the point is 
assumed to be obscured and is not plotted. The theory works well, 
and does not slow down the plotting perceptibly. In fact, if there 
were a lot of hidden points, it could possibly speed the process a 
little. 

Two entry points to the routines are required in order to handle this: 

SYS49155,x,y [TOx.y , .] draw a conventional line 
SYS49191,x,y [. . . ] draw line that may be hidden 

Printer * 

-V - ' 

The high-res plotting procedure creates some problems with 

printer dumps. The screen used is tucked away under the operating 

system ROM at EOOO. This is ideal for video, as it is free RAM that is 

easily accessed by the video chip. However, in order to read it, the 



CPU has to bank out the operating system, which makes the printer 
inaccessible. Part 1 of The Projector included a short piece of code to 
relocate the screen to $2000. where any printer dump can easily 
find it- This requires leaving The Projector after each plot, loading 
and running the relocate routine, then loading and running the 
printer dump. Effective, but not the most convenient procedure. 

The new version is all rolled into one program. It relocates the plot 
to AOOO, under BASIC, immediately before printing. Now the CPU 
can bank out BASIC, keep the operating system, and send the plot to 
the printer The call to print is: 



SYS49194,s,d 



where (size) s 

s 

(density) d 

d 



small printout 

1 double- size printout 

tight background 

1 dark background 



^ I 



Other Features 



Adding these capabilities extended the machine code beyond 4K, so 
I stashed it in the high end of BASIC storage at 9800. W must be 
protected by POKE 56,152:CLR. (The BASIC loader does this 
automatically). 

The extra space this created was used to add two more features that 
you may wish to take advantage of, though they aren't used by The 
Projector. These are a split-screen capability for interactive plotting, 
and the ability to load Koala Pad pictures for further editing. Here 
are the commands: 



SYS 49200, n 



SYS 491 97 



splitscreen, n text lines. 

n = all graphics. 

n = 1 - 1 5 number of text lines at bottom, 

n = 255 all text. 

put Koala pic at $E000, after loading. 



Load either a Koala Pad picture or a plot by The Projector; then,^YS 
49200,5 in immediate mode will give you a split screen with enough 
text lines to see what you're doing. You can then proceed to add text 
labels or any other editing you wish, then print the result. 

The 128 

I 

The new Commodore 128 has a number of built-in features that 
help in converhng the program, notably line plotting and other 
high-res commands. As a result, The Proiector is written entirely in 
BASIC, While this is a marvellous improvement, it is the usual 'good 
news, bad news" situation; the major benefit is that special 



The Transactor 



18 



January T986: Volume B, Issue 04 



machine- code routines are not required. One disadvantage is that 
Itie ROMs cannot be modified as the 64 routines were, so dealing 
with hidden lines requires some gyrations in BASIC. 

The method used to delete hidden lines is completely different from 
that used for the 64. This time, plotting proceeds from background 
to foreground; the PAINT command is used to mask out hidden 
detail by painting the area underneath each line in background 
colour. That's a little trickier than it sounds, and requires making 
five passes at each line. As a result, the plotting is considerably 
slower than with machine language - the same old slow BASIC 
problem. 

There is one compensating factor with the 1 28 - the calculations are 
done in FAST mode at 2 MHz, cutting the preparatory time In half. 
Don^t patiic when the screen goes blank; the VIC chip can't keep up 
at that speed, so output is automatically switched to the 80-coIumn 
screen temporarily. The picture will soon be back. 

The I28's coordinate system is upside-down from Gary Kiziak's, 
with Y measured from the top of the screen. To match this, all 
heights are inverted. 

Other Program Improvements 

Seven new formulae have been developed and are included in the 
programs: some are reproduced here. To make these easier to 
access, each plot is selected from a menu, using the DEF FN 
command. The vertical lines in each grid may be plotted or, as an 
option, left out. 

There is also the capability of plotting empirical data. To illustrate 
this, I've supplied some data on our famous west coast rainfall. 
Should you wish to enter your own information on budgets, ground 
contours, or whatever, here is the data format to use. !n the first line: 

7000DATATJTLE, M, N.SP 

M+ I is the number of data points in each row. N + 1 is the number 
of rows to plot. SP is a constant affecting the proportion, typically 
100 to 160. 

7010 DATA a,b,c,... 

7020 DATA d,e,f,,.. 

7030 DATA g,hj.,.^ 

There must be (M + 1)'(N+1) data points, where a,b,c is the first 
row, etc. 

When plotted in this way. patterns in the data become easy to spot. 
Note how Vancouver's rainfall increases in the late fall. (Sometimes 
it seems like it never quits! 



Listing I: BASIC portion of the new C64 projector program. For 
this program to work, the files "hiprntLmr and 'hiprnt2.mrmustbe 
present on disk when the program is run. These files can be found 
on the Transactor disk for this issue, or created by the BASIC 
programs in Listing 3 and Listing 4. 



I hope you find that The Projector Part II expands the usefulness of 
your computer, whether it's a 64 or 128. If you come up with a 
formula or set of data that produces a particularly interesting plot, Td 
be very curious to see it. Perhaps we'll be able to publish a selection 
of the best plots. Just send a copy to the address below. 

Ian Adam P. Eng. 
4425 West 12th Avenue 
Vancouver BC 
VGR 2R3 Canada 



NF 
AD 
OG 
ME 
CM 
OF 
IJ 
CJ 
IE 
AK 
AM 
JM 
JO 
KJ 
DM 
Kl 
DE 
GA 
AE 
KM 
BM 
KC 
MC 
OG 
HH 
FK 
GH 
KG 
GH 
PF 
IM 

OG 
AF 
HI 
MK 
EF 
MN 
KF 
IN 
EJ 
PA 
00 
DM 
KL 
Gl 
GE 
GF 
EH 
MD 
MH 
MB 
NB 
BF 
LG 
BO 



1000printchr$(147}" 64 projector 

1010 print" perspective plotter 

1020 print" with hidden lines 

1030 print' by lan adam 

1040 print" Vancouver be 

1050 print" december1985 

1060: 

1070 rem requires hires plotting routines 

1080 rem the transactor vof 5 issue 6 

1090 rem with extensions by ja 

1100: 

IllOif peek(38912) = 1 thena = 2 

11 20 poke 53281 .2-a 

1130onagoto1150,1190 

1140a = 1:load"hiprnt1.m|-,8,1 

1150 poke 56.152 :clr 

1160load"hiprnt2.ml",8,1 

1170: 

11 80 rem start here! 

1 1 90 gosubl 990, constants 

1 200 gosub2650, choose 

1210gosub2090, config'n 

1220 gosub2170, viewing angle 

1 230 gosub2390, get data 

1240 gosubl 390, scale 

1250gosub1580, plot 

1260gosub2550, message 

1270: 

1 280 pokel 98,0:waitl98, 1 :getb$ 

1290 If b$ = "r" then gosub2170:goto1240 

1300if b$ = "p"thensyshi,0: sys du,0,0, syste 

: gotol260: dump to printer 
1310 if b$ = "a^ then 1250 
1 320 if b$ = "n" then if dd then run 
1 330 it b$ = "n" then gosub2650 golol 220 
1340 if b$ = V then v=1-v 
1350itb$ = 'h"thenh = 1-h 
1360 if b$<>"q" then 1260 
1370 end ^ 

1380: 

1390 rem vertical scaling 
1 400 print:print"scaling data. , . 
1410vscalar = 9e9 
1420fory=0to n 
1430a = z(0,y}:forx = 1 tom 
1440 if 2(x,y)>athen a = z(x,y) 
1 450 next:rem find highest point on line 
1 460 if a then tmp = (1 99-yv(y))/a : if vs>tm then vs 
1 470 next:rem select best feasible scale 
1480: 

1 490 rem calculate rise 
1500 print". . .still scaling! 
1510fory = 0ton 
1520tm = yv(y) 
1530 for x = tom 
1 540 r(x,y) = z(x,y)*vs + tm 



= tm 



The Transactor 



19 



January 1968: Volume 8, Issue 04 



DC 
ED 
GJ 
JK 
FG 
KA 
OL 
DO 
PO 
BE 
JK 
BM 
IL 
FP 
GK 
MC 
CC 
GJ 
KL 
PO 
FL 
AO 
CO 
Ji 
DB 
MH 
Nl 
NK 
FN 
LO 
IH 
OA 
JD 
CO 
GN 
FG 
KB 
EP 
OK 
AF 
NC 
EM 
GO 
CM 
NC 
PF 
JD 
KL 
MM 
NH 
HF 
OA 
CD 
EJ 
GC 
KF 
BM 
Kl 
OP 
JD 
CI 
EO 



1550nextx,y ' ■ ' ''■''■ "" ' ' 

1560 return ' ' ■•-'■■■■ ■ 

1570: 

1 580 rem set up screen 

1590syshJ,0,0,13 

1600sysdm,1 

1610: 

1 620 rem plot horizontal lines ' 

1630sysmo,10,r(0,0) 

1640cl1=dr:iftithend1=tid 

1650fory = 0ton ■ 

1 660 tm = yh(y) 

1670 for x = 1 torn 

1 680 sysdl ,tm + xh(x),r{x,y) 

1690next)( 

1700 If y^nttien 1800 

1710: 

1720 rem plot vertical lines 

1 730 sysdr,yfi(y + 1 ) + xfi(m),r(m,y + 1 ) 

1 740 sysdl ,yfi(y) + xfi{m),r(m,y) 

1 750 for X = m-1 to step-1 

1 760 if V tfien X = 

1 770 sysmo.tm + xh(x),r(x,y) 

1 780 sysdl ,yti(y + 1) + xfi(x),r(x,y + 1) 

1790 next x,y 

1800: 

1810 rem draw box 

1820sysmo,10,r(0,0) 

1 830 sysdr, 1 0, 1 

1840sysdr,xh(m),10 

1850sysdr,xti(m),r(m,0) 

1860 3ysmo,xh(m),10 

1 870 sysdr,xh(m) + yfi{n),yv(n) 

1 880 sysdr,xli(m) + yh(n},r(m,n) 

1890: 

1900 rem title 

1 91 sysco,8:syspr, 1 ,24,a$ 

1920: 

1 930 rem wait for human 

1940wait198,3:poke198,0 

1 950 syste: print cfir$(1 47) 

1 960 return 

1970: 

1 980 rem constants 

1990hi = 49152:dr = 49155:mo = 49161 

2000 dm - 491 67:co = 491 73:te = 491 79 

2010 pr = 49182: hd =49191 :du = 49194 

2020 m =20:rem x-dimension 

2030 n = 1 6:rem y-dimension 

2040 sp = 96:rem vertical separation 

2050 th - -1 

2060 ms$(0) = ■fiide':ms$(1) = "show 

2070 return 

2080: 

2090 input'hidden lines to be shown (y/n)';b$ 

2100h=abs(b$ = -n-) 

21 1 inpufvertical lines to be shown (y/n)';b$ 

2120v = abs(b$ = -n-) 

2130 dim z(m,n),r(m,n) 

21 40 dim xh(m),yh(n},yv(n) 

2150 return 

r 

2160: 



'}'\ 



■/■ 



r--.\\\y---. 



t." 



A'^i 



A ■, '■ 111 



: -'ir 



1 i 



■<.^- 



1 1 



i_ — ---:-:-.-■- fj^ / y 




\ I'll \^W^ ^-F^' -^z f 







I 4 



SrtTSOH 




mm 

■J I i 1 1 1 
1 l-'i b': I 



STETSON, WITH M^40. H=^32 IN UNE 2030-2040 
B=10 IN LINE 54O0 




m. 



■TV. 




4 i-V 

4 in .r'h 



^Mfimmi 



miif^^^d^uMM^ 






-/y 






*- — ^ ' J ^ ■ i. I- — * 



/ 



/ 



/ 



r 



IHUERSE UAUES 



The Trantoctor 



20 



January 1986: Vblutne 8, 1»ue 04 



KF 
JC 
NF 
CP 
KG 
LD 
DD 
GO 
NN 
IJ 

CF 
BK 
DC 
Gl 
KA 
HE 
MA 
NK 
CD 
EF 
GL 
NG 
JA 
JA 
LJ 
LK 
OG 
PI 
Di 
AB 
EE 

HO 
LO 
PN 
KN 
EP 
GF 
KM 
BB 
GG 
LK 
FO 
KL 
NO 
HN 
OD 
CG 
EM 
OB 
DM 
lA 
08 
CF 
JK 



IG 
HO 
IC 
DP 
DO 
LJ 



2170 rem view angle 

21 80 if theta<0 then theta = 60:rem default angle 

2190 print.prinfenterviewingangle, or press return 

2200 prJnffor"th "degrees; ■ ',,■ ■ 

2210inputth:ifth<0orth>90then2180 ■■"' ': \ 

2220an = th*<clr>/180 ' \. , , ' '■.. 

2230 Imp = 120*cos(an) 

2240 xgrid = int((309-tm)/m) 

2250 ygrid = int(sp*sin(an)/n} 

2260 ystp = int(tm/n) 

2270 : 

2280 rem calculate offsets 

2290 for x-0 torn 

2300xhriz(x)-10 + x*xg 

23 1 next 

2320 for y = ton 

2330yfiriz(y) = yys 

2340 y vert(y) = 10 + yyg 

2350 next 

2360 return 

2370; 

2380 rem data to plot 

2390 prinl:print' creating data. . , 

2400 if dd then 2480 

241 for x-i^O torn 

2420 for y = ton 

2430 if e then r - fnr(x):s = fns(y) 

2440z{x,y)=:fnz(x) 

2450 nexty;printx,;nextx: return 

2460 ; 

2470 rem read empirical results from data 
2480 for y = Q ton 
2490 for x = torn 
2500 read z{x.y) 
2510 nextx:printy;:nexty 
2520 return 
2530 : 

2540 rem •♦♦ menus; **• 
2550 print chr${1 9)chr$(1 8};' press:"; print 
2560 print'r review from another angle 
2570 print'p send projection to printer 
2580 print"h; "mssll -h)" hidden lines ' 
2590 print"v; "ms${1 -v)" vertical tines 
2600 prinfa plot again 
261 print'n for a new shape 
2620 prinfq quit 
2630 return 
2640 ; 

2650 print:printchr$(18);"press:'; print 
2660 print" 1. stetson 
2670 prinf2. inverse waves 
2680 print"3. furrows 
2690 print"4. cascade 
2700 print"5. twin peaks 
2710print"6. crater 
2720 print"/, radial 
2730 prinf8. read data 
2740: 

2750wait198,1;geta$ 

2760 e = 0;a = val{a$):if a<1 or a>8 then run 
2770 on a gosub 2890,2940,2980,3020.3070 
3130,3180,2800 



n' 1^ ^ 




^^ 



I ^ 




TMIH PEAKS f-^ 



r- 










JV 



^/: 



J 



^im^mfhu 




I j 



}f 



ipwmimm^. 



-1-1. 



m±i:u 



wimmn-, 



/ 



^mmm^' 



I 



SI2 



i£ 



FURROUS 




/ 



/ 



/ 



'■ -i 



■ 



CRATER 



The Tronsoctor 



21 



January 1986: Volume 8, Issue 04 



HL 
KF 
EL 
IC 
CI 
BM 
PA 
FG 
BN 
BK 
EL 
ED 
HA 
JC 
FF 
GO 
10 
FF 
OJ 
OA 
GJ 
MP 
EO 
GD 
BA 
00 
LJ 
MD 
IG 
FD 
MP 
CB 
KM 

NF 
EK 
FA 
PM 

OG 
CO 
GN 
JL 
HG 

MF 
OP 
lA 
EE 

EM 
GC 
DG 

KD 
BP 
KK 
CB 
MJ 
HG 
HE 
CE 



' L 



. ^ 



\.' \J \y' \ 



*.V 



\ A. A / \ / y 



\ r \ 






RADIf^L 



2780printa$:return 

2790 : 

2800 print;printchr$(18);"press:": print 

2810prinn. rainfall 

2820 print'2, more data , ,^, 

2830 print:prinrO. first menu ' ' 

2840 wain 98,1 :geta:if a = or a>2 then run 

2850 on a gosub 3230,3470 , . ;_ 

2860 read aS.m.n.sp -'< 

2870dd=1:return "v - - -' "" .. 

2880 : 

2890a = m/2;b = 5:c-n/2:d = 2:e = .2 

2900 deffnr(x) = (x-a)/b:deffns(y) = (y-c)/b 

2910 deffnz(x) = sin(f*r*d + s's)*exp{-r*r-s*s) + e 

2920a$ = "sletson":return 

2930 ; 

2940 a = 5 

2950 deffnz(x) = sin(xty/m) + a 

2960 a$ = "inverse waves": return 

2970: 

2980a = m/2:b = n/2:c = 4:d = 1 

2990 deffnz(x) = sin({x-a)*(y-b)/b) + y/c + d 

3000a$="furrows":return 

3010: 

3020a-6:b = 2:c = .1:e--1,2 

3030 deffnr(x) = y/n-x/m:deffns(y) = r + r 

3040 deffnz(x) = (c + exp(s + r))*cos(a*r*r-a'S + e} + b 

3050 a$ = ■cascade':return 

3060: 

3070a = int(m/3):b = m-a:c = n/2:d^3:e=.1:f^.4 

3060 deffnr(x) = (x-a)'{x-a) + (y-c)'(y-c) 

3090 deffns(y) ={>;-b)*(x-b) + (y-c)*(y-c) 

3100deffnz(x) = cos(sqr(r))*{exp(-r/d) + e) 

+ cos(sqr{s})*(exp(-s/d) + e)+f 
3110 a$ = "twin peaks":return 
3120: 

3130a = m/2:b = n/2:c = 45:e = 5 
31 40 deffnr(x) = abs((x-a)'(x-a) + (y-b)*(y-b)-c) + e N-_^^"^— --_ 

:deffns(y) = . 
3150deffnz(x) = e/r + e 
3160a$ = ■crater^^eturn 
3170: 

3180a = m/2:b-n/2:c-.001:d = 40 
31 90 deffnz(x) = {abs(x-a} + abs(y-b))*sin(4 

*atn((y-b)/(x-a + c))) + d 
3200a$-"radial":return 
3210: 
3220: 
3230 poke 65,peek(61): poke 66,peek(62): rem set 

data ptr 
3240 return 
3250: 
3260 data rainfall in mm Vancouver 1975-1985. 

T1.10J60 
3270 : 

3280 data 30. 94, 83, 90, 44, 31, 7, 
3290 data 95, 266. 0, 0: rem 1985 
3300data268, 176, 132, 140, 109, 80. 1, 
3310 data 60,167,225,170,186,239,122, 
3320data 40, 84,102, 30, 99, 97,325, 
3330 data 247, 229, 68,116, 18, 28, 74, 



] ^ 



H-J, ( 



'mfrmr/ 



r. 




,^^ 




CASCADE 




29 -—- - - 



17 
98 
77 
44 



3340data 46,131,173,131, 57,106,124,173 



RAINFALL IN 



'r 



UANCOUUER 



1975-1985 



The Transactor 



22 



January 1986: Vbfume 8, Issue 04 





GL 


3350 data 130, 138, 17, 59, 89,125,274,157 


FK 


— -^ —- 

1 390 for y = to n 




MD 


3360 data 96,165,120, 71, 54,100, 74, 35 ■' 


JN 


1400tm = yv(y) ..ii\i"t^-T.a.-.-v .i?i ft ^ 




ON 


3370 data 104, 40, 319, 218: rem 1980 ■ '' ' \ 


DL 


1410forx = 0tom 




AP 


3380data 57,162, 61, 57, 49, 33, 32, 19 


PA 


1420 r(x,y) =tm-z{x,y)*vs 




PL 


3390 data 74, 76, 65.294,113, 95, 77, 84 - ' 


LK 


1430nextx,y ■ '-"■ i'"f *'''-' 




DP 


3400data 65, 23, 9,104, 96, 42,124, 88 '■ ' 


ML 


1440 return ■ "^ 




JB 


3410 data 102, 87, 84, 52, 98, 18, 51, 53 ' 


OB 


1450: 




Jl 


3420data 82, 98, 20,140,167,159,112, 87 


BD 


1 460 rem set up screen 


1 


PC 


3430 data 95, 67, 24, 84, 53, 81, 64,135 


KK 


1470coor 1,14: graphicl.l "■' 




KH 


3440data162, 126, 118, 30, 49, 31, 19,106 


GD 


1480slOW . ,->fi: -■-■]. -^^.lUMfS 

1 




FE 


3450 data 1 , 300, 21 0, 268: rem 1 975 , ' - ' ' 


GE 


1490: 




IP 


3460: '■ ' 


LG 


1500 rem plot horizontal lines ' - v ■ -' '':^ 




ED 3470 poke 65,peek{61): poke 66,peek(62): rem set 


11 


- 1 

1510 locale g(0,n),r(0,n) ■ ,- ^ . , r.-,r, rr,r^; . l-iM I 


1 

1 




data ptr 


MJ 


1520fory = nto0step-1 




EL \ 3480 return 


MH 


1530ify-nthen1620 ■ .'!^"''S ' ^^ ; 




GB ! 3490 : 


IH 


1540: 




K 


3500 data none entered.l ,1 ,100 


MO 
HP 


1 550 rem p ot vertical lines ^^" " . [ 
1560forx-m ItoOstep 1 " ■ -vT:. ^ 








CO 


1570ifvlhenx = ■ ■ " ■: 


Listing 2: The version of the new projector for the C128, No 


GG 


1580 ocateg(x,y+1),r{x,y+1) ' ■.-■' "' "^ ' ' 


: additional files are required to run this program. Make sure you 


OD 


1590 draw to g(x,y),r(x,y) ■ ' 


switch your monitor to the 40 column (C64) side to see the plots. 


ME 


1 600 next x 






i 


LJ 
Gl 


1610 if h then gosub 1850,mask , - "-:-' '^ '. 
1620forx = 1 torn i 




Nl 


1000 print clir${147)'1 28 projector' 




EH 


1010 print "perspective plotter" 


GG 


1630drawtog(x,y).r{x,y) ' -'1':^ 


EN 


1020 print "with hidden lines" 


NH 


1640 next x,y i '■' 


ioG 


1030 print "by ian adam" 


GO 


1650: ''.'--' 




10 i 1040 print Vancouver be' 


HP 


1660 rem draw box . ■ . '■ , 




GO 1 050 print "december 1 985' 


EL 


1670 locate 10,r(0,0) ' ■ "* 




IJ 


1060: 


KL 


1680drawto 10, ht ' ■" 




NM 


1070trap2170 * ■ ' . 


NH 


1690 draw to xm,ht ■ ' ^ 




DO 


1080 gosub 2010, constants 


HB 


1 700 draw to g(m,n),yv(n) 




IF 


1 090 gosub 2760, choose 


IE 


1710drawlog(m,n),r(m,n) > ' ' 




. JP 


1 100 gosub 2090, config 


LJ 


1 720 for y = n- 1 to step- 1 . ' 




j OL 


1110 gosub 2230, viewing ang e 


JK 


1 730 draw to g(m,y),r(m.y) I 


i AA 


11 20 gosub 2510, get data 


AN 


1740 next - ■ 




OJ! 


11 30 gosub 1270, scale 


JL 


1750 draw to xm,ht 




BD 1140gosub 1460, plot 


EF 


1760: . , ' 




EF 


1150 do 


DO 


1770 rem title ' - 




IB 


1 160 gosub 2670, message 


AA 


1780 char 1,1, 24, a$ 




LO 


1 1 70 getkey b$ 


CH 


1790: 




MO 


1 1 80 il b$ = r then gosub 2230: goto 1 1 30 


AC 


1 800 rem wait for human 

r 


MB 


1190ifb$ = 'p"then1140 


LG 


1810getkey b$ 




IN i 1200if b$ = 'n' then if dd then run 


JE 


1820graphfc0,1 




PA 


1 21 if b$ = "n" then gosub 2760: goto 1110 


CE 


1 830 return 




ED 


1220 if b$ = "v" then v = 1-v 


EK 


1840; 




MN 


1230jf b$ = "h"thenh-1-h 


KG 


1 850 rem mask hidden lines 




MF 


1240 if b$ = "q" then end 


GK 


1860fori--1 to 1 




GF 


1250: 


EF 


1 870 locate g(0,y) + i,r(0,y) + 3 




EM 


1260 loop 


Kl 


1880forx=1 tom 




MB 


1270 rem vertical scaling 


LM 


1890 draw to g(x,y) -f i,r(x,y) + 3 ; . 




MG 


1280vscaar = 9e9 


BH 


1900 next x,i 




BE 


1290fory = 0ton 


IC 


1910 ocateg{0,y),r(0,y) + 1 




1 


1300: 


CL 


1920forx = 1 tom 




CE 


1310a = z(0,y):forx-1 torn 


AP 


1 930 draw 0, + 0, + to g(x,y},r(x,y) + 1 




OA 


1320 if z(x,y)>a then a = z(x,y) 


AK 


1 940 next x 




GD 


1 330 next 


MF 


1950 draw 0, + 0,-fO to +8, +8 




CG 


1 340 if a then if vs>y v(y)/a then vs = yv(y)/a 


LA 


1960 paint 0,g(m,y),r(m,y) + 3 




MP 


1 350 next:rem select best feasib e sea e 


El 


1970 paint 0,g(0,y),r(0,y) + 3 




BK 


1360color4,7 ,i ■ 


FJ 


1980locateg(0,y),r(0,y) 




CM 


1370: . ,,■,■■ 


CO 


1990 return 




OA 


1380 rem ca cu ate rise 


EE 


2000: 




Th»1 


rransoctor 23 


1 Jcmuary 1988: Volume 8, Issue 04 



{ j 

■ AL \ 2010 m = 20: rem x-dimension -- . -i' '»,"'» -f - 


HP 


2630 next x: color 4,(yand1 5) + 1 : next y 




■CM 


2020n = 16: remy-dimension ■• ;, ■ i 


MG 


2640 return :; , ., ,; >f .. . ..- „... 




DH 


2030sp = 96: rem vertica separation ■ 


OM 


2650: :'■-■ ( :■ ,,m 




PO 


2040 m3${0)- "hide": ms${1)-"show -r- ^ 


CO 


2660 rem »* menus*' ^ '^"'' '■" ... 




IE 


2050ht = 190:th = -1 


HH 


1 1 

2670printchr$(19)"press:" „ rr- 




PO 


2060pi-3. 14159265 .?- K 


EE 


2680 print "r review from another ang e" 




CD 


2070 return ..:;■ 


JL 


2690 print 'h: "msSO-h)" hidden ines". - ■_--'! : ' ?jt i 




EJ 


2080 : . . , , ■ 


KE 


2700 pfinl V: "msSil -v)" vertica lines' ^ ^ ' 




HE 


2090 print "hidden lines to be shown (y/n)": getkey b$ 


LN 


2710 pnnl "p plot again' -' -'''' . .-^' . 




HE 


2100h=abs(bS<>V) -i 


HG 


2720 print 'nfora new shape", '.. v ^' '''\-'y. , ^ 




EE 


2110 print Vertical ines to be shown (y/n)": getkey b$ 


OM 


2730 prinfq quit" - - 




HH 


2120v = abs(b$<>V") 


AN 


2740 return "ii'. 




MH 


2130 dim 2(m,n),r(m,n},g m,n) 


CD 


2750 : . -■■■■ ^■^ _-■■■ ■ '.'•-.■■ _ ■' ■ ■ '^-^■" ^ '."^ 




LF . 


2140dfmxh{m),yv(n) 


HA 


2760 CO or OJ - 




C 


2150 return 


JE 


2770 print >ress:" -: '^J , _: 




EO 


2160: 


NF 


2780 print "1. stetson" : --' 




JK 


2170 rem error trap 


EM 


2790 print ■2Jnverse waves' , . , ' 




CP 


21 80 slow 


IL 


2800 print '3. furrows" 




NJ 


2190printerr$(er)el 


MO 

1 


2810 print '4, cascade" 




EO 


2200 graphic 


1 

H 


2820 print "5. twin peaks" . ■ -' 




CK 


2210 end 


1 


2830 print "6, crater' 




AC 


2220 : 


IQ 


2840 print "7. radia ' ■ : J :■ 




GJ 


2230 rem view angle 


DK 


2850 print "8. read data" 




AE 


2240 print"** screen wil be banked a whJe •♦' 


AK 


2860: 




PG 


2250 if theta<0 then theta = 60: rem default angle 


LI 


2870 getkey a$ 




FM 


2260 print: print'enter viewing angle, or press return' 


AE 


2880e = 0:a = va(a$) - 




OJ 


! 2270print'for'th"degrees:' 


LC 


2890 if a<1 or a>8 then run ' ■ ■ 




OA 


2280 input th 


HO 


2900 on a gosub 3030,3080,31 20,31 60.3210, 




EJ 


2290an-th*pi/180 




3270,3320.2930 




HG 


2300 fast 


JD 


2910 print a$: return 


C 

r 


231 tmp = 1 20'abs(cos{an)) 


MN 


2920 : 


I 


GD 


, 2320xgrid = int((309-lm)/m} 


N 


2930 print " press" 




FL 


1 

i 2330ygrid = Jnt(sp'abs{sin(an))/n) : 


00 


2940 print "1. rainfa " 


4 


10 


2340yslp-int(lm/n) 


IE 


2950 print "2. more data" 




CK 


2350 : 


JB 


2960 print "0. first menu" 




BP 


2360 rem calculate offsets 


LN 


2970 getkey a: if a = ora>2 then run 




DH 


2370 for x=0 torn 


DG 


2960 if a = 1 then restore 3360 




GN 


2380 xhiriz(x) = 10 + x*xg 


AH 


2990 if a = 2 then restore 3560 




KF 


2390 next 


NF 


3000 read a$.m.n,sp 




MH 


2400 xm = xfi(m) 


NO 


3010dd = 1: return 




JL 


2410 color 4,5 


AE 


3020 : 




LK 


2420 for y = to n 


AM 


3030a = m/2:b = 5:c-n/2:d-2:e = .2 


i 


NN 


2430 yvert(y) = fit-yyg 


DJ 


3040 deffnr(x) = (x-a)/b:deffns(y) - (y-c)/b 


1 


HO 


2440 tm = y*ys 


FL 


3050deffnz(x) = sin(r*r*d-+-s*s)'exp(-r*r-s*s) + e 


1 


DM 


2450 for X = to m 


BO 


3060 a$ = 'stetson": return 




AJ 


2460g(x,y) = xfi(x) + tm 


CH 


3070: 




LL 


2470 next x,y 


EH 


3080 a = 5 


1 


MM 


2480 return 


BO 


3090 deffnz(x) = sin(x*y/m) + a 


iOC 


2490: 


KC 


31 00 a$ = "inverse waves": return 




: FO 

1 


2500 rem data to plot 


KJ 


3110: 


NF 


2510 if dd then 2600 


CO 


3120a-m/2:b-n/2:c-4:d-1 




PA 


2520 for y = ton 


tl 


3130 deffnz(x) = sin((x-a)*(y-b)/b) + y/c + d 




DB 


2530 for x-0 torn 


AH 


3140 a$= "furrows", return 




MN ; 2540ifethenr = tnr(x);s = fns(y) 


CM 


3150: 




NP 


2550z(x,y) = fnz(x) 


Nl 


3160a = 6:b = 2:c=.l:e = -1.2 




BL 


2560 next x: color 4,(yand1 5) + 1 : next y 


KH 


31 70 deffnr{x) = y/n-x/m:deffns(y) = r + r 




GC 


2570 return 


HO 


3180 deffnz(x) = (c + exp(s + r))*cos{a*r*r-a*s + e) + b 




II 


2580: 


IM 


3190 a$ = "cascade": return 




DB 


2590 rem read empirical results 


EP 


3200 : 




PF 


2600 for y = ton 


BM 


3210a = int(m/3):b = m-a:c = n/2:d = 3:e = .1:f = .4 




DG 


2610forx = 0tom 


II 


3220 deffnrfx) = {x-a)'^(x-a} + (y-c)*(y-c) 


! HF 1 2620 read z(x,y) 


OJ 


3230deffns{y)-(x-b)*(x-b) + (y-c)*(y-c) ' ' 


The Ttontoctor 24 




Jonuary 1998: Vblume 8, Issue 04 



GF 

JO 

AD 

BJ 
LF 

KP 
00 
CG 
FE 
DP 

10 

Kl 

HM 

LE 

EA 

MG 

GP 

BM 

BK 

MJ 

AB 

GJ 

ID 

KE 

JB 

NE 

DH 

DO 
Jl 
EN 
PJ 
CF 
MM 



3240 deftnz(x) = cos(sqf(r))'(exp(-r/d) + e) 

+ cos(sqr(s))*(exp(-s/d) + e)+f ^ , M 

3250 a$ = 'twin peaks': return '"7 

3260: ■" '" ■"• '" ""■■" "■"■' •-•'"'.-.a;'-"- ! 03 ; 

3270a = m/2:b = n/2:c-45:e = 5 ' ': (1 't 

3280 deffnr(x) = abs((x-a}»{x-a) + (y-b)*(y-b}-c) + e 

:deffr3S(y) = . . .. - . ...^ ■ 

3290def!nz(x) = e/r + e ■ ... ■- ' i i ; 

3300 a$ = 'crater": return '■ r<', ' ■ ..- ■ -r-- u'^ ' 

3310 : ..-, ,■- .-., 



:-^ 






3320 a = m/2: b = n/2: c = .001 : d = 40 
3330 deffnz(x) = (abs(x-a} + abs(y-b))'SJn(4 ■ 

•atn((y-b)/[x-a + c))) + d ■ 
3340 a$ = 'radial': return . ' ■ . 

3350: 
3360 data rainfall in mm Vancouver 1975-1985, 

11,10,160 
3370 data 30, 94, 83, 90, 44, 31, 7, 
3380 data 95,266, 0, 0: rem 1985 
3390data268. 176, 132, 140, 109, 80, 1, 
3400 data 60, 1 67, 225, 1 70, 1 86, 239, 1 22, 
3410data 40, 84,102, 30, 99. 97,325, 
3420 data 247, 229, 68,116, 
3430 data 46,131,173,131, 
3440data130, 138, 17, 59, 
3450 data 96,165,120, 71, 
3460 data 104, 40, 319, 218: rem 1980 
3470 data 57,162, 61, 57, 49, 33, 32, 

65,294,113, 95, 77, 
9.104, 96, 42,124, 
84, 52, 98, 18, 51, 
20,140,167,159,112, 
24, 84, 53, 81, 64,135 
3530data162, 126, 118, 30, 49, 31, 19,106 
3540 data 1 , 300, 210, 268: rem 1975 
3550: 
3560 data none entered,,, 100 



3480 data 74, 
3490 data 65, 
3500 data 102, 

3510 data 82, 

3520 data 95, 



76, 
23, 
87, 
98, 
67, 



29 

17 
98 
77 

18, 28, 74, 44 
57,106, 124,173 
89, 125,274,157 
54,100, 74, 35 

19 
84 
88 
53 
87 



Listing 3: Run this program to create the file "hlprntl.mr for tfie 
C64 projector in listing 1. 



Al 

HD 

BJ 

AM 

FM 

CD 

MF 

EM 

NH 

CM 

ED 

OF 

KF 



JO 

DA 

IC 

CE 

GO 

CP 



1 000 rem* program to create 'fiiprntl .mt' on disk ♦ 

1 01 for J = 1 to 2640 : read x 

1020ch = cfi + x: next 

1030 if cfi<>325033 then print "ctiecksum error' : end 

1040 print "data ok, now creating file': print ■ 

1050 restore 

1060 opens, 8, 8, '0: fiiprntl. ml, p,W 

1 070 print#8,cfir${0)cfir$(1 92); 

1 080 for j = 1 to 2640 : read x 

1090 print#8,cfir${x); : next 

1 1 00 close 8 

1 110 print 'prg tile 'fiiprntl .ml' created. . . 

1 1 20 print 'tfiis generator no longer needed, 

1 1 30 rem 



1140data 76,222,195, 

11 50 data 76,124,196, 

11 60 data 76,245,198, 

11 70 data 76,202, 195, 

11 80 data 76, 33,202, 

1190data 76,236.155, 



76, 32,198, 
76, 44,196, 
76, 28,199, 
76,223,199, 
76, 27,198, 
76.148,195, 



76, 118, 197 
76,231, 198 
76, 84.199 
76,228,201 
76, 63, 152 
0, 0, 



BK 

AD 

NJ 

HJ 

OF 

PG 

GO 

EC 

NM 

CH 

OA 

FB 

DP 

JA 

CB 

LD 

LP 

AE 

PI 

BC 

GL 

LC 

El 

PK 

OP 

BL 

KC 

IP 

AM 

AJ 

NL 

PM 

MN 

GO 

KC 

ML 

KP 

OA 

GN 

KE 

FP 

PI 

JA 

IK 

OP 

FN 

Gl 

KP 

NL 



T 



CM 

PO 

MP 

PF 

JJ 

JB 

DC 

GK 

LO 

BF 

OH 

GC 



1200 data 0,255, 128, 
1210data 0, 0. 0, 
1220 data 0,208, 0, 
1230 data 0, 0, 0, 
1240data223, 0,219, 



0, 7,248, 0,129, 

1, 0, 15,240.240, 
0, 0, 0,219,219,255 
0, 0, 0, 0,255,129 
0,239, 64,223, 9,255 



36, 0,255, 

0,247, 49, 61 

1,255, 25,255 

91, 0,255, 

17,255, 0.127 



1 250 data 1 94, 255, 50, 255, 0, 255, 202, 1 55, 1 39 
1 260 data 239, 9,219, 21 9, 255, 0, 223, 0, 222 
1270data 1,255, 25,255, 8,206,194,219,219 
1 280 data 207, 211, 0, 254, 0, 246, 0, 255, 
1290data255, 0,125,36.255. 0.255, 0,166 
1300 data 0,125, 0,254, 20,255. 0,247, 17 
1310data255, 0,125, 64,254, 0,125, 32,255 
1320 data 0,255, 0,239, 0,255, 4,255, 36 
1330 data 100, 0, 255, 0, 246, 0, 254, 0, 255 
1340 data 0,255. 0,255, 0,255, 0,255, 48 
1 350 data 254, 0, 255, 0, 255, 0, 254, 0, 255 
1360data 0,255, 32, 53, 36,255,117,255, 
1370 data 109, 0, 255, 0, 255, 0, 255, 0, 255 
1380data 0,126, 32,255, 77,255, 16,255, 32 
1 390 data 21 5, 0,121, 0, 207, 0, 255, 0, 1 17 
1400 data 108, 117, 64,247,109, 
1410 data 255, 32,255, 0,254, 
1420 data too, 108, 48, 44,255, 
1430 data 64,255. 0.255.130, 
1440 data 255, 89.255,130,255, 
1450 data 12, 238. 0. 255, 202, 189, 1, 255, 194 
1460 data 223, 0, 255, 0, 255, 16, 255, 0, 251 
1470data 0.219.155,255, 8,255, 25,255. 48 
1480 data 255, 0, 127, 0, 255, 0, 255, 0,255 
1490 data 0,223, 1,255, 0,255, 0,255, 17 
1 500 data 255, 0, 255, 0, 223, 202, 21 9, 9, 200 
1510 data 0,219,219,255, 0,255, 0,255, 
1 520 data 255, 0, 255, 1 29, 223, 0, 218, 0, 239 
1530 data 64,223, 8,255,194,255, 50,255, 
1540 data 255, 202, 155, 139, 255, 8, 218, 219, 255 
1550 data 0,223, 0,222, 1,255, 25,255, 8 
1560data206,194,219.219, 95,211, 0,254, 
1570 data 246, 0,255, 0, 255, 0, 125, 164, 255 
1580 data 0,255, 0,166, 0,125, 0,254, 20 
1590 data 255, 0,247, 17,255, 0,125, 66,254 
1600 data 0,253, 32,255, 0,255, 0,239, 
1 61 data 255, 0, 251 , 36, 100, 0, 255, 0, 230 
1620 data 0,231, 0,255, 0,255, 0,173, 43 
1630 data 195, 208, 87,173, 0,221,141, 45,195 
1640data173, 24,208,141, 43,195,173, 17,208 
1650data 41,127,141, 17,208,141, 41,195,173 
1660data 22,208,141, 56,195,173, 0, 3,201 
1670data 63,208, 7,173, 1, 3,201,194,240 
1680dala 44,173, 0, 3,141, 66,194,173, 1 
1690data 3,141, 67,194,169, 63,141, 0, 3 
1700data169, 194, 141, 1, 3,173, 2, 3,141 
1710dala134, 194, 173, 3, 3,141,135,194, 169 
1720 data 96, 141, 2, 3,169,194,141, 3, 3 
1730data 96,169,127,141, 13,220,173, 61,192 
1740dala 48, 6, 32, 88.195, 32, 13,196,165 
1750 data 1,141, 60.192, 41,252,133, 1, 96 
1760da1a173, 60,192,133, 1,173, 61,192,141 
1770data 13,220. 48, 3, 32,173,195, 96, 16 
1780data 3, 76,139,227,142, 13, 3, 44, 74 
1790data192, 16,245,169, 0,133, 20,169, 
1800data133, 21,162.250,154,169,167. 72,169 
1810data233, 72, 76,163,168, 44, 61,192, 16 



The Transactor 



25 



January 1988; Volume 6, Issue 04 



LB 

KG 

EG 

KG 

FK 

OH 

FM 

FO 

MH 

FD 

Al 

FJ 

CN 

JE 

KA 

PB 

LC 

Kl 

JF 

JD 

Al 

OB 

FN 

KB 

HN 

LM 

JK 

OH 

GA 

FN 

OM 

HO 
LH 
NL 
PJ 
MM 
AL 
KB 
GH 
LJ 
KN 
OP 
KN 
CD 
Ml 
IB 
PH 
01 
Nl 
DE 
JE 
IM 
BL 
AA 
GD 
IH 
LN 
ME 
PL 
KP 
KF 
OL 



1 820 data 3 
1830 data 3 
1840 data 194 
1 850 data 3 
1860 data 164 
1870 data 208 
1 880 data 253 
1890 data 208 
1900 data 160 
1910 data 3 
1920 data 153 
1 930 data 1 1 9 
1940 data 134 
1 950 data 254 
1960 data 173 
1970 data 32 
1980 data 142 
1 990 data 1 42 
2000 data 1 
2010 data 205 
2020 data 76 
2030 data 246 
2040 data 1 62 
2050 data 208 
2060 data 162 
2070 data 76 
2080 data 1 
2090 data 234 
2100 data 
21 10 data 232 
2120 data 169 
2130 data 173 
2140 data 141 
2150 data 173 
21 60 data 193 
2170 data 15 
2180 data 73 
2190 data 25 
2200 data 1 60 
2210 data 13 
2220 data 195 
2230 data 32 
2240 data 32 
2250 data 128 
2260 data 1 92 
2270 data 192 
2280 data 240 
2290 data 1 1 3 
2300 data 221 
2310 data 17 
2320 data 1 69 
2330 data 66 
2340 data 1 28 
2350 data 1 92 
2360 data 71 
2370 data 192 
2380 data 141 
2390 data 141 
2400 data 64 
2410 data 63 
2420 data 3 
2430 data 247 



, 32,202,195, 173, 66,194,141, 





NN 


,173, 67,194,141, 1, 3,173. 


134 


HP 


,141, 2, 3,173,135,194, 141, 


3 


EB 


,169, 0, 141, 74,192, 76, 131. 


164 


EO 


,254,240, 13,160. 0,145,251, 


200 


L 


, 251 , 230, 252, 198, 254, 208, 243. 


164 


MJ 


,240, 10,136,240. 5,145,251, 


136 


IP 


,251,145,251, 96,160, 0,132, 


251 


LE 


,204, 132,252,160,232, 132,253, 


160 


PM 


,132,254, 32,136,194, 169, 0, 


168 


HN 


,119,192,136,208,250, 160, 63, 


1 

153 ! 


LB 


,193,136, 16,250,133,251.162, 


224 


ID 


,252,162, 64,134,253,162, 31, 


134 


KD 


, 76, 136,194, 32,253, 174, 32, 


138 1 


FL 


, 32,247,183, 166, 21,165, 20, 


96 


CP 


,253,174, 32,224, 194,141, 83, 


192 


1 

MK 


, 84,192, 32,221, 194,141, 85, 


192 


OL 


, 86, 192, 138,208, 21, 169, 63, 


162 


i ME 


, 44, 57,192, 16, 3,169,159, 


202 


; DJ 


, 83,192,138,237, 84,192,176, 


3 


■ BA 


, 72,178,169, 199,205, 85,192, 


144 


■ PG 


, 96,173, 18,208,240, 32,169, 


27 


, cc 


. 0,160,199,141, 17,208,142, 


24 


■ PN 


, 140, 0,221,169,200,141, 22, 


208 


DK 


, 1,142, 25,208,202,142, 18, 


208 


! HA 


, 188,254, 169,218, 141, 18,208, 


169 


JK 


,141, 25,208, 32, 13,196, 76, 


49 


GD 


,120,238, 18,208,238, 18,208, 


162 


BJ 


,142, 26,208,173, 25,208,208, 


3 


HP 


,208,248,141, 25,208, 88, 96, 


120 


. FK 


, 49,162,234,160,129,120,208, 


65 


II 


, 41,195,141, 17,208,173, 43, 


195 


EF 


, 24,208,173, 45,195,141, 0, 


221 


MD 


, 56,195,141, 22,208, 96, 32, 


,183 


OH 


, 32,221,194, 48, 46,240,105, 


41 


KN 


, 42, 42, 42, 105, 5, 73,255, 


141 


KG 


,195,141, 18,208,120, 169, 1, 


141 


B 


,208,141, 26,208,169, 35,162, 


.195 


PG 


, 127, 141, 20, 3,142, 21, 3, 


,140 


GP 


,220, 140, 61,192, 88, 96,173. 


, 43 


LP 


,240, 14, 32, 88,195, 32,113, 


,195 


HN 


, 123, 195. 169, 0, 141, 43, 195. 


, 96 


KG 


,183, 193, 32,221,194,240, 6, 


,169 


AF 


, 160, 3,208, 2,160, 7, 141, 


, 57 


MN 


,140, 58,192,152, 73,255,141, 


, 59 


MB 


,169,255, 141, 55,192, 32, 121, 


, 


CL 


, 3, 32, 44,196, 32, 88, 195. 


, 32 


IE 


,195,173, 0,221, 41,252, 141, 


, 


BD 


,169, 56, 141, 24,208,169. 59, 


,141 


LG 


,208,169,200, 44, 57,192, 16. 


, 2 


MJ 


,216, 141, 22,208, 96,169, 1, 


,141 


MA 


,192,173, 68, 192, 141, 67,192. 


,169 


AB 


,141, 56,192, 32,235,194,173. 


, 85 


HA 


. 10, 10, 10, 10, 141, 63,192 


,141 


KG 


, 192,173, 83,192, 41, 15,141 


, 62 


GL 


, 44, 57,192, 48, 12, 13, 63 


, 192 


BJ 


, 63,192,141, 71,192, 76,168 


,194 


MM 


, 33,208, 32,221,194, 41, 15 


,141 


OA 


,192, 32,221,194,141, 65,192 


,173 


GD 


,192, 76,168,194, 32,235,194 


,162 


LB 


,189, 83, 192,157, 51,192,202 


, 16 


FO 


, 96, 44, 82,192, 16, 27,169 


,119 


DK 



2440 
2450 
2460 
2470 
2480 
2490 
2500 
2510 
2520 
2530 
2540 
2550 
2560 
2570 
2580 
2590 
2600 
2610 
2620 
2630 
2640 
2650 
2660 
2670 
2680 
2690 
2700 
2710 
2720 
2730 
2740 

2750 
2760 
2770 
2780 
2790 
2800 
2810 
2820 
2830 
2840 
2850 
2860 
2870 
2880 
2890 
2900 
2910 
2920 
2930 
2940 
2950 
2960 
2970 
2980 
2990 
3000 
3010 
3020 
3030 
3040 
3050 



data 1 33 
data 252 
data 1 76 
data 199 
data 252 
data 1 02 
data 1 74 
data 16 
data 101 
data 104 
data 253 
data 74 
data 9 
data 197 
data 21 6 
data 1 33 
data 1 69 
data 20 
data 133 
data 77 
data 1 06 
data 61 
data 255 
data 45 
data 1 28 
data 48 
data 240 
data 3 
data 1 96 
data 
data 1 92 

data 149 

data 1 07 
data 
data 4 
data 133 
data 
data 133 
data 56 
data 229 
data 100 
data 1 03 
data 1 44 
data 229 
data 82 
data 6 
data 208 
data 238 
data 32 
data 3 
data 
data 1 92 
data 32 
data 98 
data 32 
data 4 
data 3 
data 24 
data 76 
data 149 
data 1 08 
data 32 



,251, 


. 24, 169, 


192, 


109, 


52, 


192. 


,172, 


, 51,192. 


177, 


251, 


,205. 


53. 


,228, 


173, 53, 


192, 


145, 


.251, 


56, 


,237, 


. 53,192, 


72, 


74, 


. 74, 


74, 


,160, 


0, 132, 


251, 


74, 


.102, 


251. 


,251, 


101,252, 


133, 


252, 


173, 


51, 


, 52, 


192, 45, 


59, 


192, 


. 44, 


57, 


, 6, 


10, 72, 


138, 


42, 


.170, 


104, 


,251, 


133,251, 


138, 


101, 


,252, 


133, 


, 41, 


. 7, 24, 


101, 


251, 


,133. 


251, 


,165, 


252, 74, 


102, 


253, 


74, 


102, 


,102, 


.253,133, 


254, 


44, 


. 57, 


192, 


,169, 


204, 5, 


254, 


133, 


,254. 


76, 


,173, 


66,192, 


201, 


3, 


144. 


240, 


, 5, 


.254,133, 


254, 


165, 


.252, 


9, 


.252, 


173, 51, 


192, 


45, 


. 58, 


192, 


, 0, 


168, 44, 


56, 


192, 


, 16, 


4, 


, 80, 


15, 36, 


2, 


48, 


. 9. 


169, 


, 2, 


. 36,107, 


48, 


1, 


, 96, 


177, 


, 55, 


192, 44, 


57, 


192, 


. 48, 


10, 


,197, 


133, 97, 


189, 


106, 


,197. 


208, 


,114, 


197,133, 


97, 


189, 


,114. 


197, 


, 49, 


251, 5, 


97, 


145, 


,251, 


177, 


, 67, 


192, 13, 


71, 


192, 


,145, 


253, 


, 64, 


32, 16, 


8, 


4, 


, 2, 


1, 


, 12, 


3, 32, 


124, 


196, 


, 32, 


121, 


, 11, 


. 32,245, 


198, 


32, 


,121, 


0, 


, 32, 


,231,198, 


32, 


20, 


,194, 


32, 


, 76, 


, 46, 194, 


169, 


1, 


,149, 


106, 


,149, 


,107, 56, 


189, 


83, 


,192, 


253, 


, 149, 


98, 189, 


84, 


192. 


,253, 


52, 


, 99, 


, 16, 20, 


169, 


255, 


,149, 


106, 


, 56, 


.169, 0, 


245, 


98. 


,149, 


98, 


,245, 


, 99,149, 


99, 


96, 


, 21, 


98, 


,149, 


,106,149, 


107, 


96, 


,165, 


99, 


,103. 


,165, 98, 


106, 


133. 


,102, 


24, 


,229, 


, 98, 133, 


104, 


169, 


, 0, 


229, 


,105, 


, 36, 107, 


16, 


228, 


, 32, 


127, 


,169. 


0, 229, 


108, 


133. 


,108, 


169, 


,109, 


,133,109. 


96, 


24. 


,165, 


102, 


, 133. 


,102, 170, 


165, 


103. 


,101, 


101, 


,197, 


, 99,144, 


18, 


208. 


, 4. 


228, 


, 12, 


,138,229, 


98, 


133. 


,102, 


165, 


, 99. 


, 133,103, 


56, 


96. 


,169, 


128, 


, 192, 


, 32,235, 


194, 


32. 


,121, 


0, 


, 32. 


, 95,198, 


76, 


89. 


,198, 


201. 


, 16, 


, 32,127, 


196, 


32 


,115, 


0, 


,194. 


, 32,121, 


0, 


201 


, 44, 


208, 


,245. 


,198, 32, 


121, 





,201, 


44, 


, 32. 


,231,198, 


32, 


95 


,198, 


32, 


,201. 


,164, 240, 


220. 


169 


, 0, 


141. 


, 96. 


, 32, 20, 


194. 


162. 


, 0, 


134. 


,146. 


,197,162, 


2, 


32 


, 146, 


197. 


,197 


, 100,165, 


99, 


229 


,101, 


144, 


,202, 


, 197, 32, 


139, 


196 


,230, 


104, 


,230. 


,105,240, 


84. 


238 


, 51, 


192, 


,238. 


, 52,192, 


32, 


246 


,197, 


144, 


,173. 


, 53, 192, 


101, 


108 


,141, 


53, 


,123 


, 198.162, 


1, 


181 


, 98, 


180, 


,100 


,148, 98, 


181. 


106 


,180. 


108, 


,148 


,106,202, 


16, 


237 


, 32, 


202, 


,139 


,196,230, 


104, 


240 


. 28, 


238, 



133 
192 
169 
133 

74 
192 
192 

24 
252 
133 
253 

48 

21 
169 
224 
170 
112 
255 
251 

61 
8 

73 
253 

96 
192 

240 
171 
169 

51 
192 
149 
169 
208 

74 
169 

99 

196 



101 

133 

98 
103 
141 
208 
164 

32 

13 
208 
121 

82 

2 

165 

39 
208 
208 
232 
192 
100 
149 
197 

53 



Tlw Transactor 



26 



January 1988: Volume 8, lisue 04 



KL 


3060data192, 32,246,197.144,241, 24.173, 51 


BG 


3680 data 28, 30, 31, 16, 28, 30, 31, 1, 21 




IC 


3070data192, 101,108, 141, 51,192,173, 52,192 


BH 


3690 data 22, 23, 24, 25, 26, 27, 1, 2, 5 




CJ 


3080data101, 109,141, 52,192, 76,183,198, 36 


NG 


3700 data 6, 0, 4, 7, 3, 8, 9, 10, 11 




ID 


3090 data 107, 16, 3, 32,139,196, 32,127,196 


A 


3710data 12, 13, 14, 15,201, 14,208, 6, 32 




HJ 


3100data 76, 46,194, 32,221,194. 41, 3, 73 


PB 


3720 data 245, 201, 76.189,201,201, 17,208, 11 




HN 


3110data 3,106,106,106,141, 56,192, 96, 32 


H , 


3730data162, 40, 32, 60,201,202,208,250, 76 




NF 


3120data221,194, 41, 3,240, 27. 44, 57,192 


FJ 


3740data 189, 201,201, 18,208, 8,169, 0,141 




EE 


3130data 16, 22,141, 66,192,170,189, 62,192 


NB 


3750data 81,192, 76,189,201,201, 29,208,143 




FP 


3140data141, 71,192,189, 67,192,141, 67,192 


CP 


3760 data 32, 60,201, 76,189,201,165,253,208 




LL 


3150dataia9, 24,199,141, 55,192, 96, 0, 85 


ML 


3770 data 2, 1 98, 254, 1 98, 253, 1 65, 3, 208, 2 




CC 


3160data170,255, 32,221,194, 10, 10, 10, 10 


CK 


3780 data 1 98, 4, 1 98, 3, 56, 1 65, 251 , 233, 8 




BA 


3170 data 141, 63,192, 44, 57,192, 48, 9, 13 


IM 


3790 data 1 33, 251 , 1 65, 252, 233, 0, 1 33, 252, 1 65 




Nl 


3180data 62,192,141, 63,192, 76, 68,199, 32 


HJ 


3800 data 251 , 201 , 0, 165, 252, 233, 224, 1 44, 1 




LG 


3190data221, 194, 41, 15,141, 64,192, 32,221 


GN 


3810 data 96,230,253,208, 2,230,254,230,- 3 




BK 


3200data194, 41, 15,141, 65,192,174, 66,192 


FF 


3820data208, 2,230, 4, 24,169, 8,101,251 




ID 


3210data189, 62,192,141, 71,192,189, 67,192 


IL 


3830 data 1 33, 251 , 1 44, 2, 230. 252, 1 65, 251 , 201 




MM 


3220data141, 67,192, 96, 32,124,196. 32,235 


DD 


3840 data 64,165,252,233,255.144, 3, 32, 60 




HO 3230data194, 162, 3,189, 83,192,157, 77,192 


MN 


3850 data 201, 96, 9, 64,174, 81,192,240, 2 




GK 3240 data 202, 16,247, 32,121, 0,240, 11, 32 


JA 


3860 data 9,128, 32,194,201,160, 7, 32, 3 




KL 


3250 data 245, 198, 32,121, 0,240, 3, 32,231 


CB 


. 3870 data 202, 177, 5,145,251,136, 16,249, 32 

1 




EE 


3260data198, 24,173, 51,192,109, 77,192,141 


LF 


3880 data 18,202,200,173, 62,192, 44, 57,192 




LF 


3270 data 83,192,173, 52,192,109, 78,192,141 


i PF 


; 3890 data 16, 8,173, 65.192,145,253,173, 64 




OF 


3280data 84,192,173, 53,192,141, 85,192,173 


CA 


3900data192, 13, 63,192,145, 3, 32,100,201 




BD 


3290data 54,192,141, 86,192, 32, 3,195, 32 


MD 


3910data104, 168, 104, 170, 96,133, 5,169, 




AG 


3300data 95,198, 56,173, 85,192,237, 79,192 


J 


3920 data 133, 6, 6, 5, 38, 6, 6, 5, 38 




NJ 


3310datal41, 85,192,173, 86,192,237, 80,192 


CN 


3930data 6, 6, 5, 38, 6, 24,173, 72,192 




AE 


3320data141, 86,192, 32, 27,195, 32, 95,198 





3940 data 101, 5,1 33, 5, 1 73, 73, 1 92, 1 01 , 6 




ID 


i3330data 56,173, 83,192,237, 77,192,141, 83 


Gl 


3950 data 133, 6, 96, 32,253,174, 32,138,173 




CO 


' 3340data192,173, 84,192,237, 78,192,141, 84 


Nl 


3960 data 32,247,183,166, 21,208, 9,165, 20 




DG 


' 3350dala192, 32, 95,198, 24,173, 85,192,109 


OF 


3970data208, 3,162,208, 44,162,216,142, 73 




NM 


'3360data 79,192,141, 85,192,173, 86,192,109 


KH 


3980 data 192, 162, 0,142, 72,192, 96,173, 14 


BK 3370 data 80,192,14, 86,192, 76, 95,198,169 


EF 


3990data220, 41,254,141, 14,220,165, 1, 41 


AE 3380 data 0,133,251,133,252, 32,241,183,224 


A! 


4000 data 251, 133, 1, 96,165, 1, 9, 4,133 




OK; 3390 data 40,144, 3, 76, 72,178,142, 75,192 


II 


4010data 1,173, 14,220, 9, 1,141, 14,220 




CN 


3400data 32,241,183,142, 76,192,138,240, 18 


HM 


4020data 96, 32,121, 0,240, 15, 32,217,193 




HN 


3410data224, 25,176,237, 24,165,251,105, 40 


GE 


4030data 32,221,194,141, 77^194.142, 81,194 




AC 


3420 data 133, 251 , 144, 2, 230, 252, 202, 208, 242 


HI 


4040data169, 128, 36,169,141, 74,192, 96,255 




FE 


3430 data 24,173, 75,192,101,251,133,251,133 


EJ 


4050 data 0,223, 9,239, 0,255, 0,255, 17 




EH 


3440 data 253, 133, 3,169, 0, 101,252, 133,252 


DM 


4060 data 255, 0, 255, 0, 223, 202, 219, 9, 202 




PD 
EL 


3450 data 24, 72,105,216,133,254,104,105,204 
3460data133, 4, 6,251. 38,252, 6,251, 38 


AG 


4070 data 2,219,219 ■,■ ■ iM ' 

1 






Nl 


3470data252, 6,251, 38,252, 24,165,252,105 




.— , 




LJ 


3480data224, 133,252,173, 61,192, 72, 48, 3 


Lislii 


ig 4: This program creates the file 'hiprnt2.m]". also needed 




HM 


3490data 32, 7,196, 32,253,174, 32,158,173 


for th( 


? program in Listing K ■ - , 




CK 


3500data 32 143 173 32,166,182,170,160, 




. iJ ' 




^^1 \ 

EK 


3510 data 232, 202, 208, 7,104, 48, 3, 32,173 


OE 


1000 rem* program to create file 'hiprnt2,m ' on disk • 




BA 


3520 data 195, 96,177, 34. 32,105,200,200, 76 


LC 


1010 for j=1 to 1136 : readx . '_/ 




FG 


3530 data 86,200.133,215,138, 72,152, 72.165 


BJ 


1020ch = ch + x: next . , .1. 




OK 


3540data215, 48, 17,201, 32,144, 28,201. 96 


ON 


1030 if chOI 45475 then prinfchecksum error": erwl 




KN 


3550data144, 4, 41,223,208, 2, 41, 63, 76 


FM 


1040 print "data ok, now creating fi e": print 




Bl s 3560 data 139, 201, 41,127,201,127,208, 2,169 


CD 


1 050 restore ,. . , .; . "■ 




AE:3570data 94,201, 32,144,125, 76,137,201.201 


OF 


1060open8,8,8;0:hiprnt2,m,p,w" 




HC 


3580data 14,208, 6. 32,248,201, 76,189,201 


EL 


1070print#8.chr$(0)chr$(152); / 




ON 


3590data201, 17,208, 11,162, 40, 32,100,201 


BH 


1080forj-1 to 1136 : readx -_ 




NE 


3600 data 202, 208, 250, 76,189,201,201, 18,208 


CM 


1090print#8,chr$(x); : next 




PF 


3610data 8,169, 1,141, 81,192, 76,189,201 


ED 


11 00 close 8 


:ge 


3620 data 201, 29,208, 6, 32,100,201, 76,189 


AG 


1110 print 'prg file 'hiprnt2, ml' created, . . 




CA 


3630 data 201, 162, 3, 44,162, 15,221.237,200 


KF 


1 1 20 print 'this generator no longer needed. 




AG 


3640 data 240, 6,202, 16,248, 76,189,201,189 


1 


11 30 rem , , 




iP 


3650 data 253, 200, 10, 10, 10, 10,141, 63,192 


IH 


1140data 1, 3, 7. 13, 15. 14, 4. 10, 8 




GM 


3660data 44, 57,192, 48, 6, 13, 62,192,141 


LP 


1150data 5, 12, 6, 2, 9, 11. 0, 0, 68 


MK 3670data 63,192, 32, 68,199, 76,189,201, 5 


JH 


lieOdata 17, 34,102,170,221,238,119,187,255 


The Transactor 27 




Jonuary 198S: Volume 8, Issue 04 



LK 


1170data 10, 77, 27, 35, 27, 16, 51, 27, 


HC 


1790 data 2,170, 32,210,255, 41, 51, 10, 10 


BJ 


1 1 80 data 200, 75, 27. 13. 10, 1,144, 75, 27 


PD 


1800data141, 83,192,138, 41,204, 74, 74,112 


BJ 


1190 data 13, 10, 10, 13, 0, 77, 27, 50, 27 


KB 


1810data131,162, 0,142, 85,192, 10, 46, 85 


JM 


1200data217, 0,152,240, 3,136, 16,248, 96 


PD 


1820data192, 10, 46, 85,192,174, 85,192, 96 


MP 


1210data 32,235,194,173, 83,192,240, 2,169. 


KD 


1830data160, 5,169, 61,162, 4, 32,186,255 


MC 


1220data255, 141, 81,192,169, 15,168, 45, 62 


FF 


1840 data 169, 0, 32,189,255, 32,192,255,162 


AM 


1230data192, 32, 54,152,173, 71,192, 74, 74 


LB 


1850 data 61, 32.201,255,162, 7,189, 27,152 


CJ 


1240data 74, 74, 32, 54,152,152, 48, 2,169 


LC 


1860 data 32,210,255,202, 16,247, 96,162, 6 


KM 


1250 data 0,172, 85,192,208, 2, 73,255,133 


PL 


1870data189, 47,152, 32,210,255,202, 16,247 


JA 


1260data 2,169, 61, 32,195,255,169, 0,133 


AM 


1880 data 169, 61, 32,195,255, 32,204,255,173 


JC 


1270 data 253, 133,251, 169,224, 133,252, 169,160 


HJ 


1890data 60,192, 9, 3,133, 1,104, 48, 3 


EA 


1280data 133,254, 32, 20,194,160, 0,177,251 


Kl 


1900data 32,173,195, 96,162, 34,169, 0.157 


GB 


1290 data 145, 253, 200, 208, 249, 230, 254, 230, 252 


MH 


1910data 84,192,202, 16,250,169, 3,141, 83 


OB 


1300 data 208, 243, 32, 46,194,173, 61,192, 72 


BJ 


1920 data 192, 160, 0,177,251, 72, 32, 7,155 


OD 


laiOdata 48, 3, 32, 7,196,169,204,133,252 


PL 


1930 data 104, 174, 84,192,208, 8, 41,240, 74 


BK 


1320data169, 190, 133, 254, 32,109,154,169, 40 


CK 


1940 data 74, 74, 32, 10,155,136,208,233,230 


DC 


1330data141, 75,192, 32,176,154,165, 1, 41 


EN 


1950 data 252, 206, 83,192, 48, 6,208,222,160 


EC 


1340data254. 133, 1,174, 81,192,240, 11,169 


LO 


1960 data231. 208, 220, 174, 84,192,208, 42,173 


D 


1350 data 12, 32,210,255, 14, 75,192, 76,143 


DO 


1970data 57,192, 16, 37,141, 84,192,173, 33 


Dl 


1360 data 153, 169, 25,141, 76,192,160, 5,185 


EM 


1980data208, 41, 15, 10,170,189, 88,192,105 


PE 


1370 data 35,152, 32,210,255,136, 16,247, 32 


AC 


1990 data 4,157, 88,192,169,216,133,252,208 


EJ 


1380 data 235, 153, 44, 57,192, 48, 46,173, 79 


00 


2000data179, 41, 15, 10,170,254, 87,192,208 


FH . 


1390 data 192, 105, 150, 162, 0,138, 42,141, 77 


BA 


2010 data 3,254, 88,192, 96,169,232,133,251 


EK : 


1400data192, 141, 78,192, 10,141, 79,192, 13 


PO 


2020data169,207, 133, 252, 160, 0,162, 0,185 


HB 


1410data 77,192,141, 77,192,173, 80,192,105 


KK 


2030data 88,192,106,141, 83,192,185, 87,192 


HC 


1420data150, 144, 11,238, 78,192.238, 78,192 


PA 


2040 data 106, 110, 83,192,106, 44, 57,192, 16 


KA 


1430dala238, 79,192,162, 3,142, 80,192,160 


OP 


2050data 4,110, 83,192,106,105, 0,157, 87 


FM 


1440dala 7,177,253,162, 4,142, 81,192, 32 


00 


2060 data 192, 200, 200, 232, 224, 16, 208, 220, 162 


AM 


1450data 92,154, 72,189, 77,192,106, 46, 83 


08 


2070data 0,142, 85.192,142, 83,192,169, 


OB 


1460 data 192, 106, 46, 83,192,104,206, 81,192 


NJ 


2080data141, 77,192,188, 0,152,185, 87,192 


JM 


1470data208, 235, 173, 83,192, 69, 2, 32,210 


FF 


2090data201, 35,176, 17,109, 77,192,141, 77 


LF 


1480data255, 136, 16,217,206, 76,192,240, 23 


CD 


21 00 data 192, 201, 35,176, 12,224, 15,176, 8 


AB 


1490 data 56,165,253,233, 64,133,253,165,254 


■ LP 


2110dala232, 144, 229, 173, 77,192,208, 1,232 


MA 


1500 data 233, 1,133,254,173, 81, 192,240, 138 


OP 


2120data142, 84,192,173, 85,192,238, 85,192 


JD 


1510 data 208, 80, 76,143,154,206, 75,192,240 


BP 


2130 data 174, 83,192,188, 0,152,153,103,192 


LC 


1520data248, 165, 197, 201, 63,240,242, 24,173 


L 


21 40 data 232, 236, 84,192,144,244,224, 16,144 


EB 


1530data 81,192,170,240, 7, 73,128,141, 81 


OM 


2150 data 187, 14, 85,192, 14, 85,192, 14, 85 


CC 


1540 data 192, 48. 6, 165,253,105, 8,133,253 


BO 


2160 data 192, 14, 85,192,202,189,103,192, 44 


EF 


1550data165, 254, 105, 30,133,254,202,138, 56 


CL 


2170data 85,192, 48, 4, 10,112, 1, 10,168 


MD 


1560dala 48, 1, 24,165,251,105,232,133,251 


KN 


2180 data 185, 16,152,157,103,192,202, 16,234 


KP 


1 570 data 1 65, 252, 1 05, 3, 1 33, 252, 232, 208, 3 


FO 


2190 data 162, 16,202,188, 0,152,185, 87,192 


GP 


1580dala 76,199,152,169, 25,141, 76,192,160 


HH 


2200 data 208, 7,169,255,153, 103, 192,208,240 


NP 


1590data 5,185, 41,152, 32,210,255,136, 16 


IP 


2210data185, 103, 192, 141, 83, 192,169,255,153 


H 


1600 data 247, 32,235,153,160, 7,177,253, 44 


IJ 


2220 data 103, 192,202, 188, 0,152,185,103,192 


HB 


1610data 81,192, 16, 4, 10, 10, 10, 10, 44 


HG 


2230data205, 83,192,240,239,173, 33,208, 41 


NH 


1620data 57,192, 48,124,162, 4, 10, 72,173 


DD 


2240data 15,170,189,103,192,141, 77,192,169 


BK 


1630data 79,192,144, 3,173, 80,192,106, 46 


NK 


2250data 0,141, 85,192, 96,162,127,160, 64 


00 


1640 data 83,192,106, 46, 83,192,104,202,208 


CN 


2260data134, 252, 132, 251,162,204, 160, 0,134 


N 


1650 data 234, 173, 83,192, 69, 2,170, 32,210 


HH 


2270data254, 132,253, 162, 131,160, 39, 32, 62 


CH 


1660data255, 41. 85, 10,141, 83.192,138. 41 


PN 


2280data156, 162, 131,160, 40,134,252,132,251 


KJ 


1670 data 170, 74, 13, 83,192, 32,210,255,136 


IM 


2290data162, 216, 160, 0,134,254,132,253,162 


JO 


1680data 16,188, 76, 54,153, 56,165,251,233 


CP 


2300data135, 160, 15, 32, 62,156,173, 16,135 


FH 


1690 data 40,133,251,176, 2,198,252,160, 


MG 


2310data141, 33,208, 32,183,193, 32,230,195 


OA 


1700 data 177, 251, 72, 41, 15,170,189,103,192 


GH 


2320 data 162, 96,160, 0,134,252,132,251,162 


BP 


1710data141, 79,192,104, 74, 74, 74, 74,170 


HO 


2330 data 224, 1 60, 0, 1 34, 254, 1 32, 253, 1 62, 1 27 


GP 


1720data 189, 103,192, 44, 57,192, 16, 3, 32 


PE 


2340data160, 63, 32, 62,156, 96,142, 78,192 


OP 


1730 data 25.154.141, 80,192, 96,141, 78,192 


KL 


2350data140, 77,192,160, 0,177,251,145,253 


EP 


1740data 165, 252,170, 41, 3, 9,216,133,252 


KP 


2360 data 165, 252, 205, 78,192,208, 8,165,251 


00 


1750data177, 251,134, 252, 41, 15,170,189,103 


MJ 


2370data205, 77,192,208, 1. 96.230,251,208 


ED 


1760 data 192, 96, 32, 92,154, 72,189, 77,192 


EP 


2380 data 2, 230, 252, 230, 253, 208, 227, 230, 254 


JP 


1770data 41,240,141, 83,192,104, 32, 92.154 


AD 


2390 data 208, 223, 0, 255, 0, 255, 0, 255, 


NH 


1780data189. 77.192. 41, 15, 13, 83,192, 69 


NO 


2400 data 255, - 



ITw Trontoctor 



2a 



January 1988: Volume 6, Issue 04 



Computer Generated 
Holography on a C64 



Patrick Hawley 
Port Elgin, Ontario 



, . Jhe key is knowing that diffraction effects are described by a Fourier Transform. 



Introduction 

In this programming project a Commodore 64 is used 
to produce a plot which can be photographically re- 
duced to become a computer generated hologram. 

When most people think of holograms, they think of the small 
pictures on their credit cards or the covers of National Geo- 
graphic magazine {March/84 or Nov./85)- These three- 
dimensional holograms are the record of an interference pattern 
made by a lensless photographic method that uses lasers. The 
interference pattern contains both the phase and amplitude 
information necessary to construct an image by the diffractioEi 
and interference of light. Computer generated holograms, such 
as the one that will l^e described in this article, are diffractioEi 
gratings (which is basically what a hok>grani is) that give two- 
dimensional diffraction patterns of an input image. 

Background 

In order to understand what the program does, a basic under- 
standing of interference and diffraction of light waves is re- 
quired. The term interference is used to describe the combining 
of two or more waves of the same frequency in the same region 
of space. Whether the i^iterference is constructive or destructive 
depends on the phase relationship between the waves. If the 
waves are in phase their aiuplitudes will add; if the waves are out 
of ptiase, then their amplitudes will subtract. As will be ex- 
plained, it is the constructive and destructive interference of light 
waves thai makes the light and dark spots found in a diffraction 
pattern. 

Diffraction is the term used to name a phenomenon that light 
possesses, which is that it spreads on! when passing an edge. An 
explanation for this can be given in terms of interference effects 
within a single beam whe[i the light beam is thought of as the 
sum of many individual sources (Huygen's principle). Diffraction 
effects are most noticeable when dealing with narrow beams of 
light when the effect of tfie light spreading around an edge 
means that geometric optics can no longer be applied- 
Insight can be gained into i[iterference, diffraction and diffrac- 
tion gratings bv considering the ca,se of a beam of light passing 
through two slits as shown i[t Figure I. The lines sfiowing the 
light represent a specific phase of the wave (the wave crests if 
you like). As tlie waves hit the slits part of them will go through. 
On the "downstream'^ side of the slits, the light spreads out in all 
directions due to diffraction. This causes the two beams co[ni[ig 



SCREEN 




DIFFRACTED LIOHT 



OPAQUE PLATE 
WITH SLITS 



LIGHT BEAM 



Figure 1: Light diffracted by a double slit. A distant 
screen would show' a difha<1ion pattern of light and dark 
spots corresponding to areas of constructive and destruc- 
tive interference. 



from the slits to overlap. If a screen is placed at a distance that is 
far compared to the distance between the slits, a diffraction 
pattern can be seen. Wherever the overlapping beams interfere 
constructively, the screen will be bright. Wherever the overlap- 
ping beams interfere destructively, the screen will be dark. For 
example, if the two beams must travel the same distance to 
reach a given point on the screen, they will arrive there in ptiase 
and make a bright spot. If one beam must travel half a wave- 
length more than the other to reach a given point, it will arrive 
out of phase, and that point will be dark. These regions of 
alternating bright and dark iiiteEisity are called interference 
fringes and the whole image on tfie ,screeri is the interference or 
diffraction pattern. The diffraction effects seen ou a screen that 
is far compared to the distance between the slits (as in this case 
are called Fraunhofer diffraction. 



Now the concept of the computer program can be explained. We 

want a program that will arrange slits in such a way that when 

ight is diffracted by the slits the resulting diffraction pattern 



The Transactor 



29 



January 1988: Volume 8, Issue 04 



forms a predetermined input image. Our arrangement of slits 
can then be called a hologram. 

To go further we must know something about the mathemalical 
description of light. Light is an electromagnetic wave which can 
be described using complex numbers. The key to constructing 
the program is knowing that the effect of Fraunhofer diffraction 
is desc:ribed by a Fourier transformation. 



- \ 



Fourier transforms are themselves the subject of books. Briefly, 
what Fourier transforms do is distinguish the frequency compo- 
nents in a varying signal. (Converseiy. inverse Fourier trans- 
forms give the domain of a signal whose frequency components 
are known). The proof that Fourier transformations describe 
Fraunhofer diffraction and that they can be used as described 
here to generate holograms goes beyond the scope of this article. 
For ttiosc interested, the proof may be found in a paper by 
Lohmann and Paris in Applied Optics, Vol. 6, No. 10, Pg. 1739. 
The essential thing to know is that the Fourier transform will 
provide the information required to tell us how to position our 
slits to make the diffracted light hit the screen at the right phase 
and how big to make the slits so that the light reaches the screen 
with the right amplitude. 

Method 



The desired input image is drawn on a grid. The input data is an 
array of binary elements made up by assigning a zero to any part 
of the grid which doesn't make part of the image and a one to 
any part of the grid which does make part of the image. The 
input data is transformed using a two-dimensional complex 
Fourier transform. The coefficients of the transform are then 
used to calculate the information required to make a plot of small 
black rectangles on a page. - - ^ 



I - 



'y\ Vi ' >', - 



thL I 



To make the plot, the paper is divided into equally spaced cells. 
Rectangular apertures {i.e. the slits} are drawn inside each celL 
Each aperture has three parameters: its height, 'hjnmt', its 
width, 'w', and its centre with respect to the centre of the cell, 
'cjnmt'- The subscripts, nm, indicate to which cell on the page 
the aperture belongs. Figure 2 shows one of the cells and 
aperture. The height of the aperture is made proportional to the 
calculated amplitude and the position of the aperture is made 
proportional to the calculated phase. ■ ■ 

When the plot is reduced down on film to become a hologram, 
and monochromatic, coherent light is shone through, we get a 
Fraunhofer diffraction pattern which is a reconstruction of our 
original input image. The hologram is now doing the inverse of 
the original Fourier transform which we applied to the input 
data. 



To make the slits, a printer or plotter is used to draw small black 
rectangles on a piece of paper. When this page is photographed, 
the black rectangles are clear on the negative and we have our 
slits. The details of the procedure are as follows: 











I w 

1 « ► 






^^H 










Y = mdy 


1 

- - -r 

1 
1 1 


1" 






1 






X=ndx 

L 




■ 


4 



Figure 2: Typical aperture in a cell. The height, h 
encodes amplitude information and the position, C 
encodes phase information. 

The Transactor 



ncihi 



Ehm? 



The Program 

The first part of the program asks for some input. The first option 
is whether or not you want to make a hologram plot. At this time 
I should point out that aside from producing the hologram plot 
the program also has the feature that it continues on and works 
backwards, starting with the final data used to create the plot, to 
reconstruct the original input image. The image is then drawn 
with the printer using a gray-scale made up from ten characters 
available from the Commodore keyboard- 1 found this feature 
very useful for checking my input data, debugging the program, 
and for getting a qualitative feeling for the image quality 1 might 
expect without going through the trouble of photographing a 
plot. If you select the option of not doing the plot, you still gel the 
gray-scale reconstructed image. 

Next, you are asked If you want to keep the phase of the input 
elements constant or if you want them randomized {but still 
binary). Explanation: The two parts of the complex input data 
give the real and imaginary components of the input wave. The 
phase is given by the arctan of the imaginary part over the real 
part. The magnitude is given by the square root of the sum of the 
squares of the real and imaginary parts. Thus the input phase 
can be made random while keeping the magnitude constant so 
the input remains binary, if you keep the input phases constant, 
the dynamic range of the transform will be quite large, with a 
few of the elements disproportionately larger than most. The 
result of this will be that after normalization, most of the 
amplitudes will be small and your plot will be mostly of tiny 
rectangles which in turn will give a dim image. This can be 
overcome somewhat by truncating the larger coefficients and if 
you choose a constant phase input the program will scan the 
transform and help you decide how much truncation you want 



30 



January 1988: Volume S, Issue 04 



to do. It's fun to try to optimize the finai image with different 
amounts of truncation using the gray-scale output to make 
qualitative judgements- .... 

— - r ' 

If you randomize the phase of the input data, the dynamic range 
of the transform will be reduced and the distribution of the 
amplitudes more uniform. This gives the best final image. 

After these decisions have been made, the matrix which makes 
up the input figure is read. As can be seen in the listing, the ones 
in the 32 X 32 matrix being read form the image of a ^^happy 
face". This data is used to input values to the arrays AR(D,E) and 
Ai(D,E) which represent the real and imaginary components of 
the ''happy face" wavefront. The choice of an imput image must 
be made keeping in mind that the final image quality is depen- 
dent on the number of sampling points used to mathematically 
represent the input wave (i.e. the number of points in the grid on 
which the original figure was drawn). The more points available, 
the more complex the figure can be, however, the figure should 
be simple enough so that it can be easily represented within the 
given matrix size. 

There are other restrictions as welL Since the results of sampling 
from the grid have to be read into our computer, the grid size is 
limited to arrays which can fit into the available computer 
memory. Also, the Fourier transform is performed using a so 
called Fast Fourier Transform algorithm which requires that the 
matrix dimensions must be m X n where m and n are an integral 
power of two. The Fast Fourier Transform used here i adapted 
from a FORTRAN listing by D.E. Jones in a paper that Jones 
wrote while a student at University of Toronto. 

These are the considerations which led to a matrix size of 32 X 
32 and a ''happy face" figure. Other appropriate input figures for 
this size matrix could be letters of the alphabet, Chinese charac- 
ters, the symbol for peace, or whatever. 

After the Fourier transform has been completed, the coefficients 
of the transform are used to calculate an amplitude and phase for 
each component. The amplitudes are then scanned, and the 
largest is used to normalize the amplitudes to between zero and 
one (unless a constant phase was used in the input data, in 
which case there is an option to normalize with a smaller 
number and truncate the larger amplitudes to one}. We now 
have the required information to make the plot. 

I will describe the plot routine in some detail since this is the part 
of the program that you will probably be modifying should you 
want to follow through on this article and try this on your own 
computer The way you choose to make your plot will affect the 
final image quality so it's best to have some guidelines before 
starting- First I will describe how the plot routine listed here 
works, then I will discuss what to consider should you be using a 
plotter ■ ' " 

I produced the plot on a Commodore 1526 printer. Each cell is 
two printer characters (1 6 pixels) wide and two printer charac- 
ters (16 pixels) tall. The rectangles to be placed inside the cells 
are four pixels wide. Avoiding the complication of having rectan- 



gles overlap at eel! edges, this allows for a maximum of 13 
horizontal positions (quantized phase values) and nine rectangle 
heights (quantized amplitude values) if you count zero as one of 
the heights. - ' 

To plot specific pixels with a 1526 printer, you must define 
custom characters. Thus to make the plot, I first set up an array, 
CH$(IJ), which contained all the different characters 1 would 
need to make the apertures of varying heights and positions 
within a cell. The large number of characters required, and the 
complexity of the plot routine, is mainly due to the fact that each 
cell is made up of four (2 X 2) printer characters. 

J I ,' I ■'' " '^ ■ ' 

In the two-dimensional array, CH(l,J), the first Indicia keeps 
track of characters of different horizontal positions while the 
second keeps track of characters of different height. The correct 
height indicia is found by multiplying the normalized amplitude 
by eight (since on the 1526 printer, characters are eight pixels 
tall) and determining to which of the nine quantized values the 
amplitude belongs, A similar process is used to find the horizon- 
tal indicia except that now the phase is used to find the offset 
from the middle of the cell. ■■ , . . ■ 

r 

It takes two rows of characters to make one row of rectangular 
apertures. First thetophalf of a row of apertures is printed, then 
the bottom- The plot routine keeps track of which half is 
currently being printed and if it's the bottom half, the character 
height indicia is shifted to print characters of the proper size 
which meet the bottom of the top half of the rectangle and grow 
downwards. You may also note that the 1 526 printer can handle 
only one custom character at a time and has a one line buffer. 
This explains the need for all the tabbing and carriage returns. 

By now some of you must be thinking that there must be a better 
way Tm sure there is. For example, those who have systems 
that can provide the required resolution may be able to do it 
neatly on a hi-res screen which is then simply dumped on a 
printer or those with plotters may have another way. At any rate, 
here are some guidelines which can be used when setting up a 
plot routine. The guidelines were drawn by reading the previ- 
ously mentioned paper by Lehman and Paris and from a paper 
by Gabel and Liu in Applied Optics, Vol. 9, No, 5, Pg. 1 180. 

The image brightness is maximized when the relative dot width 
is one half the cell width and the full width of the cell is used for 
dot positioning- li you use the full cell width, you must write a 
plot routine which will allow the dots to overiap into neighbour- 
ing cells. There will be some error in the odd cases where two 
dots overlap because these are areas which should be doubly 
transmissive. In practise though, there won't be enough of these 
cases to worry about. Lohman and Paris also showed however, 
that image brightness range increases with increasing dot width. 
They suggest that a good balance between image brightness and 
uniformity might be achieved with a dot width of one third the 
cell width. 

Gabel and Liu discuss minimizing image reconstruction error by 
optimizing the number of sample points (cells on the plot) and 
quantized steps available within a cell given the total number of 



The Transactor 



31 



Januory 1986: Vdlume 8« Issue 04 



steps available on your plotter. It turns out rtiat the plot 1 was abie 
to do on my printer in which i had up to 16 steps within each of 
32 X 32 cells was close to being an optimum arrangement. 

^-ii-^ij' -nil 

How far the images end up being spaced from the optic axis can 
be controlled by how much of the cell width is used for aperture 
positioning. The smaller the amount used, the farther away from 
the optic axis the images will be. i^^ ' 



I ' 



•■'.' 



:U' 



^ , 



I ' I 



tl' 



4 - I J 



M . 



Some other things to keep in mind are that amplitude errors 
(aperture height) aren't as important as phase errors {aperture 
position) because they do not deviate the light rays as do phase 
errors. Also, if your printer or plotter is limited, more cells or 
finer quantization can be had by doing the plot in several parts 
which can later be pasted together before the reduction. 

Running, Reduction, Reconstruction 

.1 

Once the program starts running, be prepared to wait. It takes 
over an hour for the program to run completely. 1 put in some 
print statements to the monitor so you can follow along and see 
where the program is at any given time. 

The output plot must be reduced so that the distance between 
apertures is in the order of tens of microns. This means that for a 
32 X 32 plot which is !5 cm- a reduction factor of about 100 is 
good. 

The reduction is done photographically. None of the authors of 
the papers Tve read seem to think that there's any challenge to 
this process and give no details on how it s done. I, with the help 
of a friend who's into photography, tried a few times with various 
low grain, high contrast films but we couldn't seem to get the 
exposure right. Either the apertures were filled in or the back- 
ground was too light. If anybody out there has some suggestions, 
I'd love to hear them, (My mailing address is PO Box 5106, Port 
Elgin, Ontario, NOH 2C0,) I finally sent my plots to a microfich- 
ing company who reduced them for $20.00 (see below). Even 
the best they could do was a reduction factor of 79. 




The three tiny white squares (actual size) at the center 
of the film are three separate hologram plots. 



can be found in the light coming from a laser. What!? You don't 
own a laser? Not surprising, but don't be disheartened. Most 
high schools these days have relatively inexpensive helium 
neon lasers and it's been my experience that physics teachers 
are delighted to let you borrow their laser provided you let them 
see what you've done. If you're a student, make a computer- 
generated hologram, take it into class and knock your teacher's 
socks off. 



I I 



: - 



A 1 5 cm- plot reduced by a factor of 1 00 ends up as a L5 mm^ 
hologram. This is convenient because it's about the same as the 
beam diameter of an inexpensive laser. When the laser beam is 
shone through the hologram, images of the input will appear on 
a screen placed on the other side. The images closest to the optic 
axis are first order diffraction, the next set of images are second 
order, andsq on. ■■■ I'l ' 



■ ■*'! -'Mf !':'-■ ^uj-i 



Results 



.'■■f 



i'M 



Figure 3 shows typical result of running the program. The input 
was binary data that formed a ^'happy face''. Figure 3(a) is the 
plot produced by a 1526 printer. Figure 3(b) is the gray-scale 
reconstruction of the image, also done on the 1 526. Figure 3(c} is 
a photograph of the diffraction pattern seen when a laser beam 
is shone through the hologram. Notice the dots which appear in 
the gray-sca!e picture and the reconstructed image. These dots 
are from Fourier transforming "square" data such as the quan- 
tized data we use to make our plot. 



'i I 



-II l> ^ 1 - jl J -' I 

■ ■ I i> ■ I < -lit III I'll I I I II I I I < I I I ' 
-> I'l -III I i« I I- I » I - ■ ■ I I I < 1 I < ■ I 

II I l> Ml I I I < ■ > I I I I I > I I ' I I I I J I t I I 

II I ■ • I ' I ■■ ' I J > > I > I I ■ II -Mill « I I 
> I > I ■ ^1 > I I I * * > ■ I I > I I I I I ■ I J I I J I ' I 
M ■ ■ ^ -I ' I I > 11 » I I I I II I I I i| I- I ' 11 
i ' \ I > - I I I I I I i| I J I > il I I < I ■ I I 4 |< ■ 

I I I J ■ I t I I I ■ I < 1 1 I > > I ■ ' I I I 11 I I ■ I I - 
I M < I i I I I I- < I -I I I I I I I I I > I I I I I I - I 
<<i iti-ii ||i 111 iiiiij'ii III II iiii 

i < I ■ ■ M I I I ■ I 1 'I I ■ I - * « I ii > 

' I i ■ I i ■ - ■ I .. J ■' • I t I h III ■ ■ I I I II I 

I I II I I I > I li i| ' I I I I ■ I I I I I II I I - I |t 

I I I I J f< ■ • I - I I I >| ■ > » ■ I k I I I 1 I I I L I ' 
J I I I I U ' I I ■ J I III' I I i I I I I I II I'll I 

■ iiii<li|Ml Kiia- H iiil> iii|iii 

■ I I > I I ■ 1 I I I I I I ■ I I II I I I ■ I I- I I ■ I t 
I I I • ' I ■ I I II III I r ■■ Ml I I I > |i I ■ I -1 
1 I I I I I I I I I I - I I I ■ I t I 1 1 I I III I I I I > I 
'I II ■ I I I I I I I 1 '< I ■ I I I I » I I I' » . I . . 
-I I'M I I I I I III • I ■ ■ ■ I I I I |i I ■ ■ il 'I 

II ■ I M I I I I ■ I I ■ ■ I !■ I > II I -J ■ I I II N 

■ If lii|il <l-i|i| i-l II iii-i II -I 
--■J''-ii<liii ||Ji|ii 'III I'l'iii 

I M ■ I I ■ > i| I ' < I • I I t I II ■ I ■ I I I .III I 

III 111 I I I I ■ 1 i « •' If I I I I I I I I I 'I I' t 

' ■ I I 1 » ■ ■ ■ I 1 II I I ■ ■ 1 ^ ■ - I ' I I I I ■ ■ - I I 
I 4 I iiilil i'|i«lL-ii III -'I III It I 

I M J I > J I » ■ I •' 

I I I I I I - 1 I I I I I I I I ' I I • 11 I II I 1 1 III 
I I I ■ I I I ' ' ■ I I - 1 1 ■ < I I ' I f < I'l III I I I 



In order to reconstruct the Image with the hologram we need a 
light source which can display interference effects. This means 
that it must be monochromatic and coherent- These properties 



Figure 3(a); Hologram plot from 1526 printer (54% of 
actual size). Reduced photographically, the above will 
become a diffraction grating which will form images of 
"happy faces". ■ ■■■■ ■ ■ ■ ■ ' 



The Transactor 



32 



Jamiarv 1988: Vcriume 6, Issue 04 



■ V ^' ^ \ ' 





Figure 3(b): Gray scale reconstruction of image corresponding 
to Figure 3(a). 



Figure 4(a): Gray scale reconstruction of an image ttiat 
used a constant input phase and no truncation of the 
transformed data. 




Figure 3(c): Photograph of the actual diffraction paUern pro- 
duced by shining a laser beam through the photo-reduced plot 
on film. 



Figure 4 shows gray-scale pictures which show the effect of using 
a constant input phase and truncating the transformed data. In 
Figure 4(a) no truncation was performed and as can be seen, the 
predicted reconstructed image will be of relatively poor quality. 
In Figure 4(b) the few dominant transform amplitude coefficients 
were truncated and the gray-scale picture predicts a much better 
image. 




I 



Figure 4(b): Gray scale reconstruction of an image IhcU had 
a constant input phase. The transformed data was truncated 
to limit the effect of the dominant coefficients which result 
from transforming square data. 

There are other methods of making computer generated holo- 
grams. Some record phase information on film by varying the 
emulsion thickness. The binary holograms described here are 
the easiest to make, with the required computer hardware 
probably already being available to the majority of persons who 
have read this article. ^ 






The Transactor 



33 



January 1988: Volume 8, Issue 04 



CF 
LH 
IB 
OC 
AD 
LM 
CE 
OJ 
ND 
ME 
NF 
KG 
CA 
Al 
AM 
HL 
HI 
MG 
AF 
KF 
PI 
BN 
EB 
KC 
AE 
OD 
EE 
OE 
IF 
CO 
MG 
GH 



CJ 
AJ 
OJ 
IK 
GL 
IM 
OM 
EN 
ON 
10 
GP 
AA 
OA 
AC 
CC 
AC 
KC 
ID 
OE 
ME 
KE 
KJ 
AD 
OA 
GP 
JG 
HO 
FM 
BK 



S;^ 



-i 



.■«i 



M 



"K^,- 



Computer Generated Holograms 

lb rem this program makes binary holograms 
1 5 rem by: patrick hawley, port elgin, on 

20dimx(32},y(32),s(13),u{13),ar(32,32),ai(32,32},ch$(11,15).e(16) 
30tt$ = '000000':open4,4 ■ > : 

40Jr = 1:ii = 1 -,,:''. ■ ' ■ ' '■' 

50 reSd n,it **'-.- 

60 print" . i - •« ^ 5 ■ • 

70 inpufdo you want a hologram plot {y/n)';hp$ 
80 inpufrandom or constant phase (r/c)';ip$ 
90 pq = 1 3 
100ford = 1 ton 
110fore=1ton 
120 read ar(d,e) 
130ai(d,e) = ar(d,e)-ii ■ 
140ar(d,e)=ar(d,e)*!r 
1 50 if ip$ - ■c'then200 

160ar(d,e) = (-1+2+rnd{1))+sqr(irt2 + iit2)*ar(d,e) 
170pm = int(-1 +3*rnd{1)} 

ISOif pm=0then 170 " ' ■"•''' ' ' , 

190 ai{d,e) = sqr(irt2 + iit2-ar(d,e)t2)-ai(d,e)*pm 
200 next e,d ' ' ' 

220 data 32, 1 

230 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 
240 data 0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,1,1 ,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0 
250 data 0,0,0,0,0, 0,0,0,0,0,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,0, 0,0,0,0,0,0,0,0,0 
260 data 0,0,0,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,0,0,0 
270 data 0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0 
280 data 0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.1 ,1 ,0,0,0,0,0,0 
290 data 0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0 
300 data 0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0 
310 data 0,0,0,1, 1,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,0,0,0 
320 data 0,0,0.1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0.0,0 
330 data 0,0,1 ,1 ,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,1 ,1,0,0 
340 data 0,0,1 ,1 ,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,1 ,1 ,0,0 
350 data 0,0, 1,0,0,0, 0,0, 0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0, 0,1, 0,0 
360 data 0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0 
370 data 0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0 
380 data 0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0.1 ,1 ,0 
390 data 0,1 ,1 ,0,0,0,1 ,1 ,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,1 ,1,0,0,0,1 ,1 ,0 
400 data 0,1 ,1 ,0,0,0,1 ,1 ,0,0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0.1 .1 ,0 
410 data 0,1 ,1 ,0,0,0,0,1 ,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,0,0,0,0.1 ,1 ,0 
420 data 0,0,1 ,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,1 ,0,0 
430 data 0,0,1 ,1 ,0,0,0,0,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,0,0,0,0,1,1 ,0,0 
440 data 0,0,1 ,1,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0.0,0,0,0,0,1 ,1 ,0,0,0,0,1,1 ,0,0 
450 data 0,0,0,1 ,1 ,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,1 ,1 ,0,0,0 
460 dataO,0,0,1 ,1 ,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,1 ,1 ,0,0,0 
470 data 0,0,0,0, 1,1, 0,0,0,0,0,1. 1,1, 1,1, 1,1, 1,1, 1,0,0,0,0, 0,1, 1,0,0,0,0 
480 data 0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,1 ,1 ,1 ,1 ,1 ,1 ,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0 
490 dataO,0,0,0,0,0,1, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 1,0,0,0,0,0,0 
500 data 0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1 ,0,0,0,0,0,0,0 
510 data 0,0,0,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,0,0,0,0,0,1 ,1 ,1 ,0,0,0,0,0,0,0,0 
520 data 0,0,0,0,0,0,0,0,0,0,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,0,0,0,0,0,0,0,0,0,0 
530 data 0,0,0,0,0,0,0,0,0,0,0,0,0,1 ,1.1 ,1 ,1 ,1 ,0,0,0,0,0,0,0,0,0,0,0,0,0 
540 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 

550 : ,,,,.■, 

560 gosub660:rem fast fourier transform ^ ,- ^| 

570 gosub 21 30:rem amplitude and angle ,1 

580 gosub 2370:rem normalize/truncate 

590 gosub 2900:rem hologram plot 

600 gosub 4340:rem find components for inverse fft from plot data 

610it = -1 

620 gosub 660:rem inverse fft 



IB 
GA 
Kl 
GC 
KC 
Dl 
GP 
PJ 
EN 
GK 
OB 
HG 
BN 
FD 
BC 
NC 
PI 
LA 
KA 
FF 
PL 
JM 
CI 
EG 
FO 
IP 
NE 
AK 
DB 
JA 
EB 
CP 
MP 
FE 
GO 
DP 
FB 
AE 
IM 
AA 
FO 
NC 
LI 
AA 
NA 
MB 
LC 
AP 
PP 

GP 
FA 
EC 
DO 
KC 
JD 
CC 
PO 
DN 

LG 

OJ 

HI 

HK 

PJ 

AN 



The Transoctor 



U 



630 gosub 4430:rem gray-scale plot 

640 prinffinished. time is '\\\$ 

650 end , " ^ 

660 rem 2d fft ■ ' ' . ' . ' T . 

670forrw-1 ton ', ' . ;' * 

680 print'[DN] working on fft;row:';rw 

690 for re -1 ton 

700 x(re) = ar(rw,re):y(re) = ai(rw,re) 

710 next re . . , 

720 gosub 890 

730 for re = 1 to n 

740 ar(rw,re) = x(re):ai(rw,re) = y{re) 

750 next re,rw 

770forcl = 1 ton 

780 prinf[DN] working on fft; column: ';cl 

790 for ce = 1 to n 

800 x(ce) = ar{ce,cl):y(ce) = ai{ce,cl) 

810 nextce 

820 gosub 890 

830force=1 ton 

840 ar(ce,cl) = x(ce):ai(ce,cl) = y{ce) 

850 next ce,cl 

870 return 

880: 

890 rem complex fast fourier transform 

900: 

910if it>0then940 ...i|. : 

920 tor i = 1 to n 

930y(i)--y(i): next 1 

940 Ig = log(n)/log(2) 

950if Ig<-1 then 1390 

960for k = 2tolgstep2 - 

970m-2t(lg-k) 

980m4 = 4*m 

990 for j = 1 to m 

1000ar = (j-1)/m4*2*7! 

1010 c1 =cos(ar) 

1020s1=sin(ar) 

1030c2 = c1*c1-s1*s1 

1040s2 = c1*s1 +c1*s1 

1050g3 = c2*c1-s2*s1 

1060s3 = c2*s1 +s2*c1 

1 070 for I = m4 to n step m4 

1080j0 = i+i-m4 

1090j1=j0 + m 

1100j2=i1+m 

1110j3-j2 + m 

1 1 20 rO = xOO) + x(j2) 

1 1 30 r1 = x(!0)-x(i2} 

1 1 40 iO - y(jO) + y(j2) 

115011 =y{j0)-y{j2) ^ '^^ > 

1160r2-x^1) + x(j3) 

1170r3 = x(j1)-x{j3) -i) 

1180i2-y(j1)4-yp 

1190i3 = y(j1)-y(j3) 

1 200 x(iO) = rO + r2 

1210y(jO) = iO + i2 ,,.. , 

1 220 if ar = then 1300 , , , , 

1 230 x(j2) = (r1 + i3)*c1 + (11 -r3)*s1 

1 240 y(i2) = (i1 -r3)»c1 -{r1 + i3)*s1 

1 250 x(j1) - (r0-r2).c2 + (i0-i2)*s2 

1 260 y(i1) = (J0-i2)*c2-(r0-r2)*s2 

1 270 x(j3) = (r1 -i3}'c3 +■ (i1 + r3)'s3 

1 280 y(i3) = (11 + r3)*c3-(r1 -i3)*s3 

January 1988: Vblume 8, Issue 04 



BB 

CH 

HH 

NJ 

KG 

NJ 

OJ 

CG 

BB 

GF 

CC 

AD 

HC 

FD 

JD 

KC 

NA 

AB 

BL 

CK 

PJ 

AH 

DN 

KG 

DF 

00 

HA 

HD 

AK 

AB 

JC 

KD 

LE 

BE 

FF 

JG 

NH 

MJ 

GH 

CD 

PH 

PM 

EF 

DK 

PO 

Gl 

01 

FO 

EE 

PO 

AF 

JP 

MF 

DA 

10 

NA 

EH 

OG 

JB 

EJ 

HG 

CH 

AA 

FL 

JD 



rV 



1 290 goto 1 360 

1300x^2) = r1 +13 ,,i , ■-.. ^i-x 

1310y(j2)-i1-r3 .■ 

1320x(j1) = r0-r2 

1330y(j1)-i0-i2 '■ ■' "'■ " '" " ' ■: 

1340x(j3) = r1-i3 ■ ■■ '■' ■.-■■ 

1350y(j3)-i1+r3 '- ■■, 

1360 next ij,k 

1 390 it lg = int(lg/2)*2 then 1500 "■ 

1400 for i = 1 ton step 2 

1410rO = x(i) + x(i + 1) 

1420 r1 =x(i)-x{i+1) 

1430i0 = y(i) + y(i + 1) 

1440i1=y(i)-y(i+1) 

1450x(i)-r0 

1460y(i) = i0 

1470x(i + 1) = r1 

1480y(i + 1} = i1 

1490 next i 

1 500 s(1 3) - n/2 

1510u(13) = n 

1520tork = 2to12 

1530j=14-k 

1 540 s® = 1 

1550uO)-s(j+1) 

1 560 if s(j + 1)>1 then s(j) = int(s{i + 1 )/2) 

1 570 next k 

1580al = s(2) 

1590 jj = 

1600 a = 1: b = a:c = b: d = c: e-d:f = e 

1660 for g = ftou(7) step s(7) 

1670 for h = g to u(8) step s(8) 

1680 for i==h to u(9) step s(9) 

1 690 for j = i to u(1 0} step s(10) 

1 700 for k - j to u(1 1 ) step s{1 1 ) 

1710torl = ktou(12)steps{12) 

1 720 tor m = I to u(1 3) step s(1 3) 

1730jj=jj+1 

1740if jj< = mthen 1810 

1 750 1 = x(jj) 

1 760 xOI) = x(m) 

1770x(ni) = t 

1 780 1 - y(jj) 

1 790 y(jj) = y(m) 

1800y{m) = t 

1810: 

1820 next m,i,k,j,i,h,g 

1890f = f + s(6) 

1 900 if f< = u(6) then 1660 

1910e = e + s(5) 

1 920 If e< = u(5) then 1650 

1930d = d + s(4) 

1940 if d< = u(4) then 1640 

1 950 c = c + s(3) 

1 960 If c< = u(s) then 1630 

1970b = b + s(2) 

1 980 If b< = u(2) then 1620 

1990a = a + 1 

2000 If a< == al then 1610 

201 for si = 1 to(n-2)/2 

2020bc-n + 1-sl:fc = sl + 1 

2030tx = x(fc):ty = y(fc) 

2040 x(fc) = x(bc):y(fc) = y(bc} 

2050x(bc) = tx:y(bc)-ty 

2060 next si 



V J > 



FJ 

tc 

Fl 

LK 

NB 

EG 

EO 

NG 

PF 

MG 

ML 

FJ 

GP 

LB 

DJ 

CL 

KA 

GD 

CJ 

KN 

KJ 

PP 

HC 

KM 

FC 

JG 

BO 

KE 

MK 

KB 

CB 

DK 

JF 

GG 

IL 
FE 
BH 
JN 

IF 

LC 

MC 

EO 

HM 

EN 

BF 

LE 

FE 

PD 

BE 

LN 

DB 

JB 

PA 

BJ 

AH 

NB 

HK 

01 

LC 

NL 

MK 

JD 

DN 

KM 



I 41 



2070 Efit>0 then return 

2080 for i = 1 ton - -!■ ■^■ 

2090x(i} = x(i}/n 

2iooy(i) = -y(i)/n 

2110nexti 

2120 return ^'^ ■'^^ ' 

21 30 rem convert into amplitude & angle 

21 40 print". . .finding amplitude & angle" 

2150ford = 1 ton 

2160fore=1 ton . , - j, 

2170ap = sqr(ar(d,e)*ar(d,e) + ai(d,e)*ai(d,e)} 

21 80 if ap-0 then 2330 ■- ■ 

21 90 if ar(d,e)<>0 then 2230 

2200 if af(d,e)<0 then pa = -Tr/2 

2210 If ai{d,e)>0 then pa = Tjf2 

2220 goto 2320 ' -- ' 

2230 If ai(d,e)<>0 then 2270 

2240 If ar(d,e)<0 the npa = rr 

2250 if ar(d,e)X) thenpa = - 

2260 goto 2320 

2270pa = atn{ai(d,e)/ar(d,e)) ■' 

2280 if ar(d,e)>0 and ai(d,e)>0 then pa = pa 

2290 if ar(d,e)<0 and ai(d,e)X) then pa = n + pa 

2300 If ar{d,e)<0 and ai(d,e)<0 then pa = pa-n 

2310 If ar(d,e)>0 and ai(d,e)<0 then pa= pa 

2320ar(d.e) = ap: ai(d,e) = pa 

2330 next e,d 

2350 return 

2360: 

2370 rem amplitude normalization routine 

2380 rem find largest amplitude 

2390ta = ar(1,1) 

2400 for d = 1 to n 

2410fore = 1 ton 

2420ifar{d,e)>lathenla = ar(d,e) 

2430 next e,d 

2450 if ip$ = "r" then 2820 

2460 print"the largest amplitude is';la 

2470 rem check amplitude distribution 

2480 p8 = 0: p6 = 0: p4 = 0: p2 = 0: pi =0 

2490 n8 = .8*1a:n6=.6-la:n4 = .4*la:n2 = .2*la:n1 =.1*la 

2500 print" " 

2510lord = 1 ton 

2520 for e = 1 ton 

2530 if ar(d.e)< - n8 then p8 = p8 + 1 

2540 if ar(d,e)< = n6lhen p6 = p6 + 1 

2550 if ar(d,e)< = n4 then p4 = p4 + 1 

2560 ifar(d,e)< = n2then p2 = p2 + 1 

2570ifar(d,e)< = n1 thenpl=p1 +1 

2580 next e,d 

2600p8-int(p8/1024*100):p6 = int(p6/1024H00) 

:p4 = int{p4/1024*100) 
2610p2 = inl(p2/1024*100):p1=int(p1/1024*100) 
2620 prinf80% of the max. amp is";n8 
2630 print p8;"% of amp's are equal or smaller" 
2640 pnnt" * 

2650 prinf60% of the max. amp is";n6 
2660 printp6;"%of amp's are equal or smaller" 
2670 print" ' 

2680 print"40% of the max. amp is";n4 
2690 prinlp4;'% of amp's are equal or smaller" 
2700 print' " 

2710 prinf20% of the max. amp is";n2 
2720 printp2;''% of amp's are equal or smaller' 
2730 print" ," 



The Trantocfor 



25 



January 1968: Vblume &, Issue 04 





PE 


2740 prinfl 0% ot the max. amp is";n1 


GO 


4070tb-tb+1:prinl#2,ch$(10,ht):print#4.tab(tb); 




NO 


2750 printpl ;'% of amp's are equal or smaller' 




Chr$(254);chr${141); 




10 


2760 print" ' 


MP 


4080 goto 4260 ■ 




JL 


2770 prinftime IS 'M ..!.■ . ' -.■ 


BO 


4090print#2,ch$(1,ht):print#4,chr$(254);chr$(141); 




MP 


2780prinf ■ ,■'-./. 


JD 


4100tb = lb-+-1:print#2,ch${9,hl):prJnl#4,tab(tb)i 


{ DK 1 2790 inpufwhat no. do you want to norma ize to";n 




Chr$(254);chr$(141); 




■ AB j 2800 print' " '-■- - '~' " - 


DE 


4n0tb = tb+1:print#2,ch$(9,ht):print#4,lab(tb); 




■CH 


2810 inpufwtiich means what % of data truncated';pt 




cbr$(254);chf-${141)i 




CA 


2820 if ip$ = rthenn =la 


EC 


4120goto4260 




HA 


2830 for d = 1 to n 


KE 


4130 if cp<0 then 4180' , . "■■■'. i ■■ 




EB 


2840 for e = 1 to n 


PK 


4140cp = cp + 11-cp*2 vV,> -7 0' '^'' 




El 


2850 ar(d,e) = ar(d,e)/nl: if ar(d,e)>1 then ar(d,e) = 1 


OG 


4150print#4,'[1 spc]";chr${141); 




DP 


2860 next e,d 


KJ 


41 60 tb = tb + 1 :prjnt#2,ch$(cp,ht):prjnt#4,tab(tb); 




MF 


2880 return 




chr$(254);chr$(141), 




OL 


2890: 


GF 


4170goto4260 


AB \ 2900 rem pel routine 


BH 


41 80 if cp>0 then 4230 ■ ■ 




ED 


291 rem read in plot characters ' 


LL 


4190cp = abs(cp)+1 !■ ■ ■^\'^ 




DD 


2920 if hp$ = 'n' then 3720 


HF 


420Gprint#2,ch$(cp,ht):print#4.chr$(254J;chr$(141); 




EG 


1 2930 print', , .defining p ot characters' 


MC 


421Gtb = tb + 1;print#4,tab(tb);" 1 spc)';chr$(141): 




PC 


2940 for i = 1 to 8:e(i) - 2ti-1 ;e(i + 8) - e(i)*2t(8-'i):next 


II 


4220 goto 4260 




DM 


2950 for i = 1 to11:forj-1 to15:fork=1 to 8 


ON 


4230 If ht = then 3990 "^ /' 




Kl 


2960ch-0:ifk<(13 i)andk>(8 i) then ch - e{j) 


AA 


4240 if ht<8 then ht = ht + 8 ■ .' ^ ' 'A 




DE 


2970 ch$(i,i) = ch$(i,l) + chr$(ch) 


CM 


4250 goto 3990 




GL 


2980 next k,j,i 


N! 


4260 if e = n then print#4.chr$(141);chr$(13); ' , '^ 




CP 


3710: 


FJ 


4270tb = 2*e:if e = nthentb = , "" 




HD 


3720 open 2,4,5 


FB 


4280 if e<>n then print#4,tab(tb); , ' ■'- U-- 




PJ 


3730 open 6,4,6,print#6,chr$(21) 


PK 


4290 next e,f,d > v- ... 




MK 


3740 rem main plotting loop 


MP 


4320 return r . 




MA 


3750 tb=0 


OF 


4330: ■ '" '-", 




PH 


3760 nf = 2: if hp$ = 'n' then nf = 1 1 


HN 


4340 rem find rea and imaginary components from 




DL 


3770 for d=1 ton 




truncated S. quantized data '■■. ' . ^. 




LN 


3780forf=1 tonf 


EA 


4350 for d = 1 ton:fore = 1 ton - '^/i 




KM 


3790 for e=1 ton 


KO 


4370ap = ar(d,e) . '■ ' ■' i 




IL 


3800 rem determine which character 


PM 


4380ar{d,e) = ap*cos{ai(d,e)) . '^ ■ '; 




NH 


381 rem find character height 


PL 


4390ai(d,e)-ap*sin(ai(d,e}) ■ 




ME 


3820ht = 8*ar(d,e) 


HP 


4400 next e,d > ■ . ■'' - '' 




LD 


3830dh = ht-int(ht) 


AG 


4420 return '^i 




KL 


3840 if dh<. 1 25/2 then ht = int(ht):goto3860 


CM 


4430: , ■ t..'.. 




LJ 


3850ht = int{ht) + 1 i 


FP 


4440 rem grayscale picture routine 




GG 


3860 if f = nf then ar(d,e) = ht/8'nl 


EE 


4450 prints." 1 spc]' i 




OM 


3870 rem find phase 


FG 


4460ford = 1 ton ■ ^ " 




ON 


3880cp = pq-ai{d,e)/(2*n) 


BH 


4470 print#4,tab(23); ■ ■ ' ^. 




BF 


3890qp = int(pq/2) 


MH 


4480 lor e=1 ton 




DD 


3900ifabs(cp)-int(abs(cp))>.5then3950 


GN 


4490in = sqr(ar(d,e}*ar(d,e) + ai(d,e)'ai{d,e)) 




L 


391 if cp<0 tfien cp - int(cp):it f - nf then 


BE 1 


4500 af = 1/sqr(ir*ir + ii*ii):in = at*in - • 






ai(d,e) = (cp+1)»n/qp 


ID 


4510ifin>1 thenin = 1 




DN 


3920 if cp> = then cp = int(cp) + 1 :if f = nf then 





4520 if in<.1 thenprint#4/[l spc]"i:goto4590 ' ' 






ai(d,e) = (cp-1)»n/qp 


AN 


4530 if in<,2 thenpnnt#4,""i:goto4590 




LB 


3930 if hp$--n'then 4290 


DP 


4540 if in<.4 lhenprfnt#4/:"i:goto4590 : 




L 


3940 goto 3980 


DP 


4550 if in<.6 thenprint#4;'^:goto4590 




EJ 


3950 if cp<0 then cp - int(cp)-1 :!f f = nf then 


KG 


4560if in<.8lh6nprint#4,chr$(166)::goto4590 






ai(d,e) = (cp+1)»n/Qp 


KF 


4570ifin<.9thenprintM;RVS *[OFF ■;:goto4590^'^ ■ I 




NJ 


3960 if cp>Othen cp - int(cp) + 2: if f = nf then 


HO 


4580if in< = 1 thenprint#4," RVS] 1 spc][OFF]'i ^V [ 






. ai(d,e) = (cp-1)'n/qp 


LP 


4590 if e - n then print#4,chr$(1 3); 




DE 


3970 if hp$ = 'n' then 4290 


PL 


4600 nexte,d 




AE 


3980iff<>1 then 4230 ■ . ■ - 


00 


4620 print#4;[1 spc]' . . "^'' •■ -■ 




NP 


3990 if ht = then print#4.' 2 spcs]";chr$(141);:goto4260 


JK 


4630 print#4, 'input real ampitude:";ir 




NA 


4000 if abs(cp)>2then 41 30 


LM 


4640 print#4/input imaginary amplitude:';ii 




FP 


4010 If cp>-2 then 4050 


Jl 


4650 print#4/phase ang e:';ip$ 




NJ 


4020print#2,ch$(3,ht):print#4,chr$(254);chr$(141); 


FB 


4660 print#4,"no. of phase quantization leves:",pq ■ ' 




IM 


4030 tb - tb + 1 :print#2.ch${1 1 ,ht):print#4,tab(tb); 


NB 


4670 if ip$ = T- then 4700 






chr$(254);chr$(141); 


DL 


4680 print#4, "transform normalized with. . ."jnl 




EN 


4040 goto 4260 ■■ ■ " ' 


LJ 


4690 print#4,''percent of transformed amp's 




LP 


4050 If cp>1then 4090 ■ ■ ■ 


1 


truncated, . "ipt ' i ^<* ■' '■ ' ■ - 


' EM 1 4060print#2,ch$(2,ht):print#4,chr$(254);chr$(141); 


H 


4700 return 






The Transactor 36 


January 198S: Vblume S, Isaue 04 



CIRCLES 
for the C64 



'■ "Vzi , ■■ 



I _ 



t' 



r I I L T 



^ r^ . U .]^.' 



Anthony Bryant 
Winnipeg, Manitoba 



^»/.fHl 




Every graphics programmer needs to draw circles. Fast assem- 
bly code circles are at best a challenge and at worse a headache. 
it is an opportunity to use a variety of integer math algorithms, 
testing one's latest GW (gee-whiz) super fast routines. , , , , ■ 

The program CJRCLES.BAS demonstrates two of the best known 
circle-drawing algorithms. It uses HIRES by Gary Kiziak (Vol.5 
Iss-6 of the Transactor, reprinted in Vol.8 l5S.2) for the underly- 
ing graphics primitives. It's in Basic, so it's slow, but also easier to 
study, and then translate to assembly code. 

Polygons 

So called, because varying the increment INC (in degrees) yields 
various polygons (try 1NC = 45). The presence of sines and 
cosines would seeni a formidable barrier to translation. 

A circle is symmetrical, such that knowing the value of one 
point, it can be reflected across the x-axis or across the y-axis. 
That is, if we know (X,Y) is a point on the circumference, then so 
is (X,-Y). The same is true for (-X,Y) and (-X,-Y). If you divide 
the circle into quadrants then you only have to code an arc over 
to 90 deg. These observations also apply to ellipses, (a circle is 
really a special case of an ellipse) so that we can have a separate 
x-radius and y- radius. 

Potential ^ 

The second method is called a 'potential function' and is based 
upon the realization that the screen cannot plot points except 
with integers. Every point connects with its neighbor, so if you 
are at one point on the circumference and trying to figure where 
the next point is, you can only go in eight directions. , ,, ., 



T : I . 



\' < 



This algorithm is more easily converted to assembly, having as it 
does only the need to multiply and divide. Note that the slowest 
routine in Basic can potentially be the fastest in assembly! 





■f,i. . 


POLVGONS ,,,!,-, 


\ 

A 


\ J 


/ 2 


"yA 






1' 


. ;.r i / ■• ' 


) ^ 


^^^- 


W 




\ 


G 


^ 


1 


V 



\' i\\ 



■■ .E 



-'i; -' i 't . ■ . 



I ii 



Faster CIRCLES 



■' \ 



■ r I ^ 






Mi ■ 
11 



J J ri 



POTENTIALPAL is a strict translation of this algorithm which 
you can relocate where you like. The syntax is: * 



f y 



where: 



1000 SYS CIRCLE,XC,YC,XR,YR 

XC is the X axis centre 

YC is the y axis centre 

XR is the x axis radius 

YR is they axis radius 



I ^ 



"It/ 






;V' ' 



POLYGON, PAL is a translation of the sines and cosines al- 
gorithm reflected about the x and y axes. The syntax is: 

1000 SYS C1RCLE,XC,YC,XR,YR[,SA,EA.1NC] ' 

where additionally: ' -'■'' 

SA is the start angle in degrees 
EA is the end angle in degrees .. 
INC is the increment in degrees 



. M 



Note that the angle parameters are optional and may be omitted 
in any order, just use commas as place holders. 



Source Notes 



/ 



While the 'potential function^ method is fast it is the least flexible 
and takes up 122 more bytes. The 'polygons routine' gains a lot 
in speed by using a sine function lookup table. A table of 90 
values for 90 degrees yields a resolution of 1 degree. This is 
admittedly a compromise between table size, and useful resolu- 
tion. In use, its just as fast and more flexible. Not only do you get 
circles and ellipses, but also arcs and polygons. And the main 
loop, which calculates radius and theta, can be readily applied to 
new graphics commands that require polar coordinates, such as 
rotation. 



' 



The Transactor 



37 



January 1988: Volume 8, Issue 04 



A graphic command like CIRCLE, depends so much on fast 
underlying primitives, like PLOT and DRAW. 'HIRES' has a fast 
line-DRAW algorithm, but a faster point-PLOT could be coded to 
make use of a Y-lookup table. Two hundred byles (0-199 y 
values) though, would be a lot of extra overhead, it's true! 



Coding CIRCLES, gives one a chance to dust off the old 
computer-math text books or to add new books to your library. 
Something to play with on cold and rainy winter days. 



CIRCLES.BAS: Using the polygon algorithm (170-290) fol- 
lowed by the potential algorithm (310-650). The generalor for 
Garry Kiziak's "HIRES" ML subroutines is not shown here, but 
can be found in Volume 8 Issue 2 (or on Disk ^IS}. It will also be 
included on Transactor Disk *2I for this issue. 



DM 
LF 
IN 
KE 



GB 

LN 

FO 

EB 

GN 

CH 

DA 

IM 

AG 

LG 

HO 

DA 

OJ 

FA 

CB 

IL 
NP 
AK 
HE 
OP 

PI 
FC 

EJ 
BO 
HM 
JC 
BE 
EK 
FL 
JK 
ED 
ID 
JM 



10 rem 'circles' in basic 

20 ifpeek(491 52)<>76thenload'hires',8,1 

100: 

11 hires = 12«4096: draw = hi 4-3: plot = dr + 3 

120inove = pl + 3: clscr = mo-i-3: dmode = cl + 3 

130selpc = dnn-3: colour = se + 3: box = CO + 3 

140text = bo + 3: prnt = te-H3: chset = pr-i-3 

1 50 trap - ch -H 3 

160: 

170 rem basic circles- polygons 

180 sys hires, 0,1, 6 

190xc=160:yc=100:xr = 99:yr = 79 

200sa=0:ea = 360: inc-S 

21 z1 = sa*n/1 80: z2 = ea*7i/1 80: z3 = inc*n/1 80 

220 x = xc + xr*cos(z1): y = yc-Hyr*sin(z1) 

230 sysmove,x,y 

240fori = z1 toz2stepz3 

250 x = xc-i-xr''COs(i): y-yc-Hyr*sin{i) 

260 sysdraw.x.y 

270 next 

280sysprnt,16,12,'poiygons' 

290 for 1=1 to 2000: next 

300: 

31 rem basic circles - potential 

320syshires,0,1,6 

330 xc - 1 60: yc = 1 00: xr = 99: yr - 79 

340 phi% = 0: yphi% = 0; xypfii% = 0: y% = 

: x% = xr 
350 f = 0: ifxr<yrthenf = 1 
360if f = 1 then x% = yr: tm = xr: xr = yr: yr = tm 
370 rem start loop 

380 yphi% = phi%-Hy% + y%+1 '' ' 
390 xyphi% = yphi%-x%-x%-(-1 ■ ' ' ,' ''■ 
400 iff = 0thenx2 = x%:x3 = y% 
410 iff = 1 theny3=x%:y2 = y% 
420 12% - x%: t1 % = t2%*yr/xr 
430 iff = Otheny3=t1''/o 
440 iff=1thenx2 = t1% ' '' 

450 t2% = y%:t1% = t2%*yr/xr "■'■ '' 



r^ - 



ililr 



I \1 



ItV, H"'' 



OE 

KF 

EF 

EJ 

AK 

OK 

GL 

Gl 

MM 

IN 

GO 

00 

[L 

IB 

BH 

PC 
AO 
MP 

LF 

Kl 



460 iff = 0theny2 = t1% 

470 iff = 1 thenx3 = t1% 

480 : 

490 sysplot,xc-Hx2,yc + y2 -' - r^ 

500 sys plot, xc-x2,yc-Hy2 

510 sys plot,xc-x2,yc-y2 

520 sysplot,xc-Hx2,yc-y2 

530 : " 

540 sysplot,xc-i-x3,yc-Hy3 

550 sys plot,xc-x3,yc -n y3 

560 sys plot,xc-x3,yc-y3 

570 sysplot,xc-(-x3,yc-y3 

580; 

590 phio/o = yphi%:y% = y'yo-(-1 

600 if abs(xyphi%)<abs(yphi%) then 

phi% = xyphi%: xo/o^xo/o-l 
610 if x%>y% goto 380 'loop for more 
620: 

630sysprnL16,12,*po1entiar 
640fort = 1 to 2000: next 
650 end 



-^ rf3 



-i^, =-^" 



t ' I 



V ^ 



<-J 



, i 



-I 



i 1 . "^ . 



Creates PRG fUe POTENTIAL.OBJ 



U' ' .1, 



I h 



FG 
AC 
BJ 
NN 

FM 
CD 
BH 
OK 
GG 
CM 
ED 
DL 
KF 



GL 

EL 

LK 

NL 

CL 

PK 

10 

CK 

JK 

IE 

PH 

HP 

NO 

EA 

JF 



1000 rem creates module potential. obj 
1010forj = 1 to545: read x ^ 

1020ch = ch + x:next "" " 

1 030 if ch<>57836 then prinfchecksum error' 

:end 

1 040 print 'data ok, now creating file': print 

1 050 restore 

1060open8,8,8,"0:potential,obj,p,w' 

1070 print#8,chr$(0)chr$(128); 

1080 tor i = 1 to 545: read x ■ '■: ■ 

1090 print#8,chr$(x); : next ' ■ 

11 00 close 8 

moprinfprgfile 'potential, obj' cr^bd. . . 

1 1 20 print 'this generator no longer needed. 

1 1 30 rem 

11 40 data 99, 0. 79. 0, 70, 0, 55, 

1150data162, -3,189, 43,192,157, 47, 

11 60 data 202, 16,247, 96,162, 3,189, 

11 70 data 192, 157, 0,128,202, 16,247, 

llSOdata 32,135,193, 32, 8,128, 32, 

1190 data 193, 32, 20,128,169, 0,133, 

87, 133, 88, 133, 41,133, 
0,128,133, 39,205, 2, 
1,128,133, 40,237, 3, 

34,169,255,133, 38,173, 
1240 data 128, 133, 39,170,173, 3,128, 
1250data 40,168,173, 0,128,141, 2, 
1260 data 142, 0,128,173, 1,128.141, 
1270 data 128, 140, 1,128,166, 42,134, 
1280 data 165, 41, 10, 38, 90, 56,101, 

I -I I . I ' , '^' 



v. ,-.'! 



1200 data 133, 
1210data173, 
1220 data 173, 
1230 data 176, 





192 

43 

96 

135 

38 

42 

128 

128 

2 

133 

128 

3 

90 

87 



The Transactor 



38 



January 1988: Vblunw 8, Issue 04 



NF 
EC 

AE 

CH 

OG 

MM 

MF 

HH 

KJ 

AJ 

OG 

LD 

AC 

LF 

FO 

EN 

HB 

CO 

OK 

AB 

HC 

PG 

FD 

OE 

CG 

IF 

LD 

EE 

KN 

El 

El 

FN 

FP 

KB 

NO 

OA 

KB 

HN 

ID 

CK 

JN 

PL 

FJ 

EN 

KL 

KN 

lA 

LL 

OE 

OE 

DE 

AG 

PH 

MM 



1290 data 133, 89, 
1300 data 166, 40, 
1310 data 92, 133, 
1320data133, 91, 
1330 data 165, 39. 
1340 data 141, 43, 
1350 data 129, 141, 
1360 data 41, 166, 
1370 data 128, 32, 
1380 data 46, 192, 
1390 data 142, 7, 
1400 data 192, 142, 
1410data141, 45, 
1420data129,141, 
1430 data 77,129, 
1440 data 141, 43, 
1450 data 128, 174, 
1460 data 46, 192, 
1470 data 2,230, 
1480 data 87, 134, 
1490 data 134, 37, 
1500data129, 133, 
1510 data 36, 165, 
1520 data 
1 530 data 
1 540 data 
1 550 data 
1 560 data 
1570 data 173, 48, 
1580 data 192, 72, 
1590 data 192, 141. 
1600data 46, 192, 
1610 data 173, 47, 
1620 data 39, 192, 
1630 data 141, 40, 
1640 data 192, 56, 
1650 data 173, 50, 
1660 data 192, 32, 
1670 data 104, 141, 
1680 data 13, 24, 
1690 data 73,255, 
1700 data 36,134, 
1710 data 35,162, 
1720 data 102, 37, 
1730 data 2,128, 
1740 data 128, 101, 
1750data173, 0, 
1760data169, 0, 
1770 data 38, 36, 
1780 data 56,165, 
1790 data 35,237, 
1800 data 133, 35, 
1810 data 37, 165, 
1820 data 187 



91,166, 
39, 208, 
39, 197, 

3, 76, 
24, 109, 



165, 90, 101, 
134, 92, 165, 

91, 24,165, 

165, 90,229, 

166, 40,164, 
192,142, 44, 

6,128,142, 

42,141, 4, 

191,129,141, 

76,231,128, 

128, 32, 191, 

44,192,165, 

192, 142, 46, 

4,128,142, 

173, 4,128, 

192, 142, 44, 

7, 128, 141, 

32, 77, 129, 

42, 165, 89, 
88, 32,175. 

165, 91,166, 
34,134, 35, 
35,229, 37, 

92, 133, 87, 
2,198, 40, 

41,165, 40, 
108,128, 96, 

43, 192, 141, 
192,109, 44, 
173, 49,192, 

41,192,173, 
141, 42,192, 
192, 56,237, 
173, 48,192, 
192, 32, 117, 
237, 45, 192, 
192,237, 46, 
117, 195, 104, 
39,192, 76, 
73,255,105, 
105, 0,170, 

37, 169, 0, 
17, 24, 102, 

102, 36,144, 
101, 34, 133, 

35, 133, 35, 
128, 13, 1. 
133, 34, 133, 

38, 37, 38, 
34, 237, 0, 

1, 128,144, 
202, 208, 227, 

36, 166, 37, 



88, 133, 90 
39, 10, 38 
89,229, 91 
92, 133, 92 
38, 48, 37 
192, 32, 191 
7,128,165 

128, 142, 5 
45,192,142 

141. 6.128 
129,141, 43 

41,166, 42 

192, 32,191 

5,128, 32 

174, 5,128 

192,173, 6 

45, 192, 142 
230, 41,208 
166, 90, 133 

129, 133, 36 
92, 32, 175 

165, 34,197 

176, 16,165 

134, 88,165 

198, 39, 165 

229, 42, 144 

173, 47,192 

39,192, 72 

192,141, 40 

24, 109, 45 

50,192,109 

32,117,195 

43,192, 141 

237, 44,192 

195,173, 49 

141, 41,192 

192,141, 42 

141, 40,192 

117,195, 16 

1, 72,138 

104, 96, 133 

133, 34, 133 

35, 102, 34 

15, 24,173 

34,173, 3 

202, 208, 228 

128,240, 46 

35,162, 16 

34, 38, 35 

128,168,165 

4,132, 34 

38, 36, 38 

96, 76, 138 



Demonstration using POTENTUL.OBJ 



-^ ri "^ 



FM 
LF 
OP 
IN 
KE 
It 
GB 
LN 
FO 
EB 
MG 

CH 
CD 
PC 
GE 
OC 
■EP 
JB 
OG 
HA 
MB 
JJ 
GJ 
MD 
EE 
CH 
OL 
NL 
MG 
HA 
GO 
MD 
Gl 



1 



,■*'- 



1 rem ml circles using potential algorittim 

20ifpeek(49152)<>76thenload'tiires*,8,1 

30 if peek(32800)<>32 ttien load'potential.obj',8,1 

100: ' :■ '■ 

110hires-12*4096: draw = hi + 3: plot = dr + 3 

1 20 move = pi + 3: ciscr = mo + 3: dmode = cl + 3 

130selpc = dm + 3: colour = se + 3: box = co + 3 

1 40 text = bo 4- 3: prnt=te + 3: chset = pr + 3 

150trap = ch + 3 ■ ■ ->: ■ ■■ . .-.■■■ 

160: ' - ■ "■" 

170 circle = 32768 -1-32 :rem not the same as 

polygon ' ' ■ ' 

180syshires,0,1,6 '" * 
190: 

200 sys prnt,1 7,1 , "circles" ' 

210: 

220xc=155:yc=100:xr = 99:yr = 79 
230 sys circle, xc,yc,xr,yr 
240sysprnt,19,12,"1" 
250 : 

260xc = 100:yc=120:xr-90:yr-50 
270 sys circle,xc,yc,xr,yr 
280sysprnt,10,9,'2- 

290 : 

300xc-275:yc-100:xr=30:yr = 80 

31 sys circle, xc,yc,xr,yr 

320sysprnt,34,12,-3- 

330: 

340xc = 52:yc = 45:xr = 35:yr=30 

350 sys circle,xc,yc,xr,yr 

360sysprnt,6,19,"4- 

370; 

380fori-1 to 3000: next 

390 end 



Creates PRG file POLYGON.OBJ 



JG 
DB 
BJ 
AO 

FM 
CD 
LK 
OK 
JF 
CM 
ED 
BN 
KF 



1 000 rem creates module polygon, obj 
1010 for j-1 to 423 : read x 
1020ch-ch-i-x : next " ' 

1 030 if ch<>48466 then prinfchecksum error' 

: end 
1 040 print "data ok, now creating file': print 

1 050 restore 

1060open8,8,8,'0:polygon,obj,p,w" ■ ' 

1 070 print#8,chr$(0)chr$(1 28); 

1 080 f or j = 1 to 423 : read x 

1090 print#8,chr${x); : next 

11 00 close 8 '■ ' 

1 110 print 'prg file 'polygon. obj' created. . . 

1 1 20 print 'this generator no longer needed. 

1 1 30 rem 



The TRmsactof 



39 



January 1988: Vblume 8, Issue 04 





EE 


1140 data 0, 0, 0, 0, 0, 0,104, 1 


Demonstration using POLYGON.OBJ. Notice ttiat most of 




LF 


1150dala 5, 72, 32,121, 0,240, 11, 32 


this demo is a so in the previous demo. Watch the CIRCLE 




PL 


1160dala253,174,201, 44,240, 4,104, 76 


address in line 170 - it is not (tie same for botti demos. The first 




GO 


11?0data124, 193, 104, 96,162, 3,189, 43 


page of this article shows Ihe first two sample screens 


of this 




OG 


1180 data 192, 157, 47,192,202, 16,247, 96 


program. ,v . .... j,. , _.,_ ,._.. .... ,, 






J 
ON 


1190 data 162, 3, 189, 43, 192,157, 0, 128 
1200 data 202, 16,247, 96, 32,135,193, 32 




■■■'-.. rht : 




JO 


1 rem m circ es, po ygons, arcs 




KO 


1210 data 28,128, 32.135,193, 32, 40,128 


LF 


20ifpeek(49152)<>76then oad"hires',8J ; 


f 




D 


1220dala169, 0,162, 0, 32, 9,128,141 


AA 


30 if peek(32820}<>32 then oad'po ygon.ob 


•,8,1 




MN 


1230 data 4.128, 142, 5,128,169, 104, 162 


N 


100: -■ - ■ , ,. 

1 ^_ 






EH 


1240data 1, 32, 9,128,141. 6,128,142 


KE 


1 10 hires- 12*4096: draw-hi + 3: pof-dr + 


3, 


' 


HH 


1250 data 7,128,169, 5, 32, 9,128,170 


1 


120 move = p +3: cscr-mo + 3: dmode = c 


+ 3 




B 


1260data208, 2,169, 1,141. 8,128,169 


GB 


130sepc = dm+3: coour = se + 3: box = co4 


■3 


1 
1 
1 

1 


NA 


1270data 0,133, 91,133, 92,173, 4,128 


LN 


140 text = bo + 3: prnt = te + 3: chset = pr + 3 


: '^ t , 


NF 


1280data174, 5,128,160,255,200, 56,233 


FO 


150trap = ch4-3 ► ■ ' w^r , 


1 




FK 1290 data 90,176,250,202, 16,247,105, 90 


EB 


160: .,....- 


' 1^ ! 




CD 1300 data 133, 87,152, 74,144, 7,169, 90 


MN 


1 70 c re e = 32768 -f 52 : rem not the same as 






OFilSIOdata 56,229, 87,133, 87,152, 74, 74 




potentia ,.;- -t_ -:._, o-^^. 


; 00 : 




PF ' 1320 data 106, 133, 88,152, 41, 3,240, 3 


OH 


leOsyshires, 0,1,6 -; 






J 


1330data 56,233, 3,133, 89,173, 2,128. 


CD 


190: - - ,,„ ^u.., 


. M A, i 




AF 


1340data174, 3,128, 32, 33,129,164, 88 


00 


, 2005ys prnt,16,1, "Circes' ..••i---::^,^ 


■-H 


AG 


1350 data 32, 8,129, 24,109, 49,192,141 


CN 


' 210sa-0: ea-360: inc-5 - , :,,- - 


1 


1 LA 


1360 data 45,192,138,109, 50,192,141, 46 


LJ 


■ 220gosub370 ,.■ - ? _,!:-,, 


: Ui . 




)E 


1370data192,173, 0,128,174, 1,128, 32 


1 

KF i 230: - . :^ > ^n;, yy.-' 


. JO 




OP 


1380 data 24,129,164, 89, 32, 8,129, 24 


FP 


240 3ysprntJ6,1,"poygons" _, - Vi 


o:> 1 


] 


AL 


1390 data 109, 47,192,141, 43,192,138,109 


HJ 


250 sa ^ 0: ea = 360: inc = 45 ■ 


i -j, ■ 




MB 


1400 data 48,192,141, 44,192,166, 91,240 


DM 


260gosub370 , . - ■ -,;, ■ -, 


■ ■"', ■ 


■ 


LE 


1410 data 8, 32, 43,196,166, 92,240, 6 


CI 


270: .:,: .-, 


^1 i 


1 


HL 


1420 data 96,198, 91, 32,113,194,173, 8 


KN 


280sysprnt18,1,"arcs" 


. A. ' 




DK 


1430data128, 24,109, 4,128,141, 4,128 


CM 


290sa = 90: ea = 270: inc = 5 


■ 




JM 


1440 data 144, 3,238, 5,128,173, 4,128 


LO 


300gosub370 „ , , . 


. ^:; 


' 


M 


1 450 data 205, 6, 1 28, 1 73, 5, 1 28, 237, 7 


KK 


310: lv 


I'H . 




HN 


1460 data 128, 144, 2,198, 92, 76,109,128 


EB 


320 sysprnt,1 6,1, "more arcs* ,, ,; 






AE 


1470data 16, 13, 24, 73,255,105, 1, 72 


ME 


330sa-0:ea-180: inc -5 


1 




MA 


1480 data 138, 73,255,105, 0,170,104, 96 


, DB 

1 


340gosub370 .^- , 


" -'KA • 




NO 


1490 data 72,169, 90, 56,229, 87,168,104 


OF 


350 end 


. 1 ' 




JB 


ISOOdata 44,164, 87,134, 21,190, 76,129 


MN 


360: ^ ri-^ 


- ^ 

+ 




KM 


1510data134, 34,133, 20,169, 0,133, 35 


EM 


370x0-155: yc- 100: xr-99:yr- 79 ,^i 


1 i-ii- 




MP 


1520data162, 8, 70, 34,144, 11, 24,101 


CB 


380syscirce,xc,yc,xr.yr,sa,ea, nc ■ i . 


■■ 'n 




FM 


1530data 20, 72,165, 35,101, 21,133, 35 


PK 


390sysprnt,19,12,"r 


' ;■'- 




LO 


1540 data 104, 70, 35,106,202,208,235,133 


EA 


400: 






OH 


1550 data 34,166, 35, 96, 0, 4, 9. 13 


NJ 


410xc=100:yc:=^120; xr = 90:yr = 50 . - 


1 1 

i 




OE 


1560 data 18, 22, 27, 31, 36, 40, 44, 49 


KD 


420syscirce,xc,yc,xr,yr,sa,ea, nc ■ r. 






HJ 


1570 data 53, 58, 62, 66, 71, 75, 79, 83 


PC 


430sysprnt,10,9,"2" .■ - ,--' -. ;* 


H ■ ' 




FK 


1580data 88, 92, 96,100,104,108,112,116 


MC 


440: ■ , . - . , '-;. . 


f 




PD 


1590 data 120, 124, 128,132,136, 139,143,147 


CN 


450xc = 275:yc=100: xr^30:yr^80 -,%. ^ 


V 




CK 


1600 data 150, 154, 158, 161,165,168,171,175 


CG 


460 sys circle, xc,yc,xr,yr,sa,ea,inc 






CA 


1610 data 178, 181.184, 187, 190, 193, 196,199 


lA 


470sysprnt34,12,'3" - ,i- ,,,, -■.■ 


4 
1 




KC 


1620 data 202, 204, 207, 210, 212, 215, 217, 219 


EF 


480: ,. ,- .^_ V _ . . 


, 




MG 


1630 data 222, 224, 226, 228, 230, 232, 234, 236 


DF 


490 xc = 52: yc = 45: xr = 35: yr = 30 






GK 


1 640 data 237, 239. 241 . 242, 243, 245, 246, 247 


Kl 


500 sys aire e,xc,yc,xr,yr,sa,ea,inc 


J r 

r 




HM 


1650 data 248, 249, 250, 251, 252, 253, 254, 254 


NJ 


510 sys prnt,6, 19/4" 


1 




LO 


1 660 data 255, 255, 255, 255, 255, 255. 255 


MH 
CN 


520: - ^-- -- .,v V. 
530forj = 1 to 3000: next 


r r 






1 ' rf'-f ' ■ h.^ "■ ■ ^ 


—1 

-. ', 1 ■- r 1 


LP 


540syscscr,1,6 




n 


CE 


550 return 

' 1 




The Tramoctor 40 


January 1968: Volume 8, Issue 04 



Circkw: POTENTJAL-PAL 


EP 


970 


six xr :xrwilhyr 


CL 


1860 cmpt2 :<abs(phiy) 






KP 
DE 


980 
990 


Ida xf + 1 
sla yf---1 


OC 
DE 


1870 Ida 11 + 1 

1880 sbc 12 + 1 ;lhen... 


MG 


100 rem 'hires' circle- polenlial 


PG 


llOrerTi sourcefJIe by anthony bryant 


MK 


1000 


sty xr+l 


NL 


1B90 bcs else lelse. .. 


JE 


120sys700 


IG 


1010; 


IhC^ 


FJ 


1900 then Ida phixy 


LP 


I30.optn -1*. 


EL 


1020 loop 


* -r; ; main loop start 


FJ 


1910 Idx phixy + 1 


CA 


140: ^ ll^ 


KA 


1030 


idt y + 1 


BO 


1 920 sta phi 


MA 


150: '-" 


ND 


1040 


six ptiiy + 1 r 


HG 


1930 stx phi + 1 ;phi-phixv 


GN 


160 Whites' variables byg.kiziak 


LN 


1050 


Ida y -- ■■■ ' i'^ '. 


EF 


1940 Ida X 


KN 


1 70 xl = $c027 .. - ;current position 


DA 


1060 


asl ;phiy = phi + y + y + 1 


OM 


1950 bne ^ it 


MP 


180 yT = Sc029 ,. i.^^i. 


KB 


1070 


rol phiy + 1 


KE 


1960 dec x + 1 


AG 


190x2 = Sc026 . ;r>ewposilion - 


JL 


1080 


sec 


ME 


1970J2 dec X ;x = x-1 


OB 


200 y 2 = Sc02d -^ 


HF 


T090 


adc phi 


CB 


19B0eise Ida x ;rtx>= y 


GJ 


210 «C = $c02f ;circ centre (also box) 


BE 


1100 


sla phiy 


EE 


1990 cmpy ;then1oop 


Gf 


230 yc = $c031 


JO 


1110 


Ida phiy + 1 1' 


HH 


2000 Ida x + 1 .... 


Kl 


230 ^m ^ $c035 :hires/mulTi flag 


OE 


1120 


adc phi + 1 


CJ 


2010 sbc y + 1 


GG 


240: 


LD 


1130 


sta phiy + i ■i'- 


PM 


2020 bcc stop ;eisesiop 


AH 


250; 


HH 


1140 


Idx X + 1 ' .- ' 


AM 


2030 jmp loop 


BL 


1 

260 ["hires' internal subroutfnes 


LN 


1150 


stx pJihxy+1 ■-* 


BL 


2040 stop ris 


PM 


270 igeli = $cl 7c . ;inlernal geT integer 


IE 


1160 


Ida X 


H 


2050; 


10 


280iegel - $cie7 [internal eai fi ge! w,y 


EJ 


1170 


asl iphixy^phiy^-x-x + l 


00 


2060 .subroutine reflect points & plot 


IK 


290 move = $c269 , ;'move' rln 


L 


1180 


rol p^iixy + 1 


IF 


2070plot4 = ■ 


PB 


300imov = Sc271 ;internalmovetoxl,yl 


AM 


1190 


sta pihhxy 


GG 


2080 Ida xc 


BK 


aiOif^l = $c375 ;inierna[ ploi 


GC 


1200 


cic 


AK 


2090 dc ^; - 


U 


320 idrw - $c42b ■ : internal drawto 


BE 


1210 


Ida piipy 


KE 


2100 adc x2 Ti^ 


AM 


330: 


AL 


1220 


sbc phixy ' . ■ 


OJ 


2110 Sta xi : ,■ 


PI 


340 :zero page labels 


10 


1230 


sta phixy 


EM 


2120 pha ■ , 


PH 


35011 =^ $22 


LG 


1240 


Ida phiy + 1 


KF 


2130 Ida xc + 1 


CJ 


360 12 = S24 


EL 


1250 


sbc phixy+ 1 


ED 


2140 adc x2 + 1 : 


LP 


370 flag " $26 


NO 


1260 


sta phixy + 1 


1 II 


2150 sla xl +1 


OH 


380 X = $27 


MG 


1 1270; 


_ r 


MO 


2160 pha 


Ci 


390 y = $29 


AM 


1 1260 


Ida X 


BM 


2170 Ida yc ■ 


BK 


400 phi - $57 


NA 


1290 


Idx x + 1 


KP 


2180 cIC .J, 


MG 


4lOphiy = $59 


JJ 


1300 


Idy flag 


FK 


2190 adc y2 ■ i- .r^if. : 


JK 


420phixy = $5b 


KL 


1310 


bmi alln 


JP 


2200 Sta y1 


EC 


430; 


Kl 


1320 


sta x2 


LK 


2210 Ida yc + 1 


KA 


440 * = S8000 ^ ;545 bytes 


CL 


1330 


stx x2 -f 1 


Fl 


2220 adc y2 + 1 


ID 


450; 


CC 


1340 


jsr scale 


JN 


2230 sta y1 +1 


fB 


460 xr worO ;x radius 


LK 


1350 


sla y3 


OL 


2240 jsr Ipit 


FC 


470 yr wof ;y radius 


DN 


1360 


stx y3 + 1 


AB 


2250 Ida XC 


FO 


480x3 worO ;potentialy 


LB 


1370 


Ida y 


FF 


2260 sec ■"• -^m v :..-; .,(-„ 


PO. 


490 y3 wor ;poteniial x 


IG 


1380 


Idx y + 1 


CB 


2270 sbc x2 


KG 1 


500: 


CN 


1390 


Sla x3 


E 


2280 Sta xl - - 


JH 


510 .subroutine movelo xc.yc 


KP 


1400 


six x3 + 1 


KP 


2290 Ida xc+1 


HH 


520 move Idx #3 


IG 


1410 


jsf scale 


CP 


2300 sbc x2 + 1 ., .- - 


KB 


530 Ida K2,y 


PO 


1420 


sta y2 


IG 


aaio Sta xi + 1 


El 


540 sta xc,x 


HB 


1430 


stx y2 + 1 


CA 


2320 jsr ipll . /^ 


NN 


550 dex 


BL 


1440 


jmp dopll 


BG 


2330 Ida yc 


LN 


560 bpl movc + 2 


DB 


1450 altn 


sta y3 


FK 


2340 sec 


GC 


570 rls 


HD 


1460 


stx y3 + 1 


DG 


2350 Sbc y2 


KL 


580; 


EK 


1470 


}sr scale 


JJ 


2360 Sta yl , * 


EB 


r 

590 :subroubne moveio xr.yr 


KG 


1480 


sla x2 


LE 


2370 Ida yc+1 


GN 


eoOmovr Idx #3 


CF 


1490 


six x2 + l 


DE 


2380 sbc y2 + 1 


KG 


610 Ida x2,x 


NJ 


1500 


Ida y 


JH 


2390 sta yi + i 


CP 


620 sta xr,x 


KO 


1510 


Idx y + 1 


CF 


2400 jsr ipIt 


NO 


630 dex 


DF 


1520 


sla y2 


CP 


2410 pla 


HG 


640 bpl movr + 2 


LH 


1530 


stx y2 + 1 


GJ 


2420 sta xl +1 


GH 


650 rts 


KO 


1540 


jsr scale 


GA 


2430 pla 


KA 


660; 


OH 


1550 


sta x3 


10 


2440 Sla xl 


OB 


1 

670 ;sys circle, xc,yc,xr,vr 


KJ 


1560 


stx x3 + 1 


KG 


2450 imp ipH 


PG 


680 circle = * 


IJ 


1570; 




CB 


2460 . 


ND 


690 jsr leget 


NM 


1 580 dopH jsr p 0t4 


GM 


2470 ;subroutine absolute value 


MO 


700 isr move ;moveto >;c,yc 


MF 


1590 


Ida x3 . ' 


OL 


2480 absv bpl abok 


BF 


710 ]sr iegel 


E 


1600 


Idx x3 + l 


AD 


2490 cIc 


FK 


720 |sr rriovr ;nioveto xr.yr 


MK 


1610 


sta x2 


MG 


2500 eof #Sff 


FM 


730 Ida m 


EN 


1620 


stx «2 + 1 


NK 


25T0 adc #1 


HE 


740 sla flag 


FJ 


1630 


Ida y3 


EF 


2520 pha 


PE 


750 Sla phi 


NK 


1640 


Idx y3 + 1 


GJ 


2530 txa 


CD 


760 Sta phi + 1 


FN 


1650 


sta y2 


EJ 


2540 eor #$ff 


BA 


770 Sta y 


NP 


1660 


stx y2 + 1 


DN 


2550 adc ffO ' - ■ 


CP 


780 sta y + 1 


EL 


1670 


[Sr plot4 


LM 


2560 tax 


Ml 


790: 


GA 


1680; 




CJ 


2570 pla 


LH 


800 cases Ida xr 


LH 


1690 


inc Y 


PM 


2580 abok rts 


KG 


810 sta X ;x = xf 


ON 


1700 


bne |1 


EJ 


2590; 


ON 


820 cmp vf 


DA 


1710 


inc y+1 ;y=V+l 


DP 


2600 .subroutine 10 scale offset ■ 


EG 


1 J 

830 Ida xr+1 


AO 


1720|1 


Ida phiy 


LJ 


2610 scale = • :n =t2'yr/xr 


NC 


340 sta x + 1 


HL 


1730 


Idx phiy+1 :phi = phiy 


KJ 


2620 Sta t2 


J1 


850 sbc yr+1 i 


NC 


1740 


sta pht 


CM 


2630 Stx 12 + 1 


BH 


X 

B60 bcs loop .branchif xr >=^ yr 


MG 


1750 


stx phi + 1 , ->■'-, . 


LD 


2640 Ida #0 


CC 


870 swap Ida #$fl 


MD 


1760abs1 jsr absv :take abs[phiy) 


GL 


2650 Sta 11 r 


DN 


880 sla flag * ■ -^ 


IE 


1770 


sta t2 ■ 


Ci 


2660 Sta 11 + 1 


PN 


890 Ida yf 
900 sla X 


AH 


1730 


stx 12 + 1 


MF 


2670 Idx #17 


CI 


KN 


1790 


Ida phixy 


FB 


2680 cIc ;16 bit integer math 


AB 


910 lax ;x-yr 


HC 


1800 


Idx phixy + 1 


FG 


2690mullp ror t1+1 


PL 


920 Ida yr + 1 ^i 


HF 


1810abs2 jsr absv ;take abs(phixy) 


BM 


2700 ror t1 


Ml 


930 sta X + 1 


H 


1820 


sta 11 


DL 


2710 ror 12 + 1 


KE 


940 tay ;andswap '■ 


AK 


1830 


stx t1 + 1 


GN 


2720 ror 12 


KB 


950 Ida xf 


GK 


1840; 




DA 


2730 boo decnl 


DG 


960 sta yr ' . 


LC 


1850doil 


Ida t1 ;i1 abs(phixy) 


KC i 2740 cIc 


nM^ansoctor ^i 


- 


41 


January 1986; Vblum* S, Issue 04 



DC 


2750 Ida yr ;^' -"-' '^^- 


KB 


580 


rts , result in a&i.x 


GM 


1480 jsr absv ; check x sign 




IN 


2760 adc t1 - '■^'^ 


EM 


590; 




IE 


1 490 cic 




OC 


2770 sta 11 '■■ 


DN 


600 :subrouline moveto xc.yc 


EB 


1500 adc xc 




DA 


2780 Ida yr+l -" 


BN 


610 move 


fdx #3 


IE 


1510 sta x2 




IL 


2790 adc 11+1 -" 


EH 


620 


da x2.)i 


EK 


1 520 ixa 




OA 


2800 sta t1 + 1 


ON 


630 


sia nc.A ■ , ^ ' 


EP 


1530 adc xc+1 




FE 


28T0decn1dex 


HD 


640 


dex . ■■ '^ ■' 


IC 


1540 sta x2 + 1 £1*' 




BO 


3820 bne mullp 


FD 


650 


bpl move + 2 ^' 


GC 


1550 Idx $5b 




CH 


2830 Ida xr 


AJ 


660 


rts ''''^■'" •'' 


AJ 


1560 beq !p5 ;flag a moveto 




EN 


2S40 oca xr + 1 


EB 


670; 


",i 


GH 


1570 jsr idrw ;drawlo 




IF 


2850 beq error 


OG 


680 ;subrouline rr>oveto xryr 


HE 


1580 Idx $5c ■- '■'**' 1 




HB 


2860 -kta m 


AD 


690 movr 


Idx #3 - •.' 


LF 


1590 beq Ip6 




CJ 


2870 Sta M , , 


EM 


700 


Ida x2,x 


MC 


1600 rts 




OF 


2880 sta 11 + 1 ! 


ME 


710 


sta xrx '" 


EA 


I610lp5 dec $5b ;cancelflag 




JA 


2890 tdx #16 ;16 bit integer math 


HJ 


720 


dex 


IP 


1620 jsr imov ;moveio '"^ 




HL 


2900divlp rof 12 


BM 


730 


bpl movr + 2 '' 


CE 


lesoipr-' Ida delta - 




JJ 


2910 rol 12 + 1 1 


AN 


740 


rts " ' ' 


ON 


1640 do 




PN 


2920 rol t1 


EG 


750; 


.r\ r-,- 


KB 


1650 adc arcst '■' - ■ - 




LK 


2930 rol 11 + 1 


LH 


760 ,sys cirde,xc,yc,xr,yrl,sa,ea,inc] i 


AH 


1660 sta arcst ''^- ■'^''^' '■■^' ' "'^ 




NP 


2940 sec 


JM 


770 circle 


= m 


AH 


1670 ■ ■ bcc Ip7 ' '"■ ' 




EK 


2950 Ida t1 


HJ 


780 


jsr ieget 


NE 


1680 inc arcst+1 




EA 


2960 sbc xr 


GE 


790 


isr move ;moveto xc.yc 


KL, 


1690 Ip7 fda arcst ^ 




JG 


2970 lay 


LK 


800 


|Sr legel 


PP : 


1 700 cmp arcend 




E 


2980 tda ti + 1 


PR 


810 


|sr movr ;move1o xr,yr 


LE ■■ 


1710 Ida arcsi + l ' ' ^'■ 




EO 


2990 Sbc <r + l 


PB 


820 


Ida m 


KO 


1720 sbc arcend + 1 ' ' ' ' 




CB 


3000 bcc decn2 


LP 


830 


Idx #0 : default arcst 


PK 


1730 bcc IpB -■-..: 




OH 


3010 sly 11 


HB 


840 


isr gelan ;gel sa (degrees) 


LN 


1740 dec $5c ;cance flag ' ^ 




KO 


3020 sia tl -t- 1 


GE 


850 


sta arcst 


P8 


1750lp8 jmp loop ■ "'" 




DC 


3030 decn2de>; 


DJ 


860 


six arcst + 1 


GF 


1760; 




KL 


3040 bne divlp 


JP 


870 


Ida #<360 


KA 


1 770 .subroutine absolute vaue ' ' ' ■ 




OG 


3050 rol 12 


LN 


880 


Idx #>360 .delaull arcend 


CA 


1780 absv bpl abok 




PC 


3060 rol 12 -f 1 


NC 


890 


jsr gelan ;9et ea (degrees) 


EH 


1 790 cfc 




OB 


3070 Ida 12 


i N 


900 


sta arcend 


AL 


1800 eor ft$n 




GE 


3080 Idx 12 + 1 


KE 


910 


six arcend + 1 


BP 


1810 adc tt\ /"' ' 




OP 


3090 rts 


. IP 


920 


Ida #5 ;detautt delta 


IJ 


1820 pha ■ 




GH 


3l00error imp $bb8a ; "division by zero* 


EF 


930 


jsr gelan ;get mc (degrees) 


KN 


1830 Ixa ' 




MJ 


3110; 


' HH 


940 


tax 


IN 


1840 eor #$« 




MA 


3120 end 


MK 
FH 


950 
960 


bne crcl 

Ida #1 [minimum 


HB 
PA 


1850 adc #0 - ' ' 
1860 ' lax ■ ' 












MG 


970 crcl 


sta del la 


GN 


1870 ■ pla 




Clnrks: POLYGON -PAL 


PL 


960 


Ida #0 


NP ■ 


I880abok rls ;resuriin a&.x 








N 
FO 


990 

1000 


sia $5b 1 
sta $5c / 


IN 

DF 


1890; 

1900 ;subrouline cafoulale sinefunc — - ' 




CF 


lOOrerr^ 'hires' circle - polygon 




PG 


llOrem source Me by anihony bryant 


JL 


1010 loop 


Ida arcst 


PP 


1910 calccos pha 




JE 


1 20 sys 700 


FP 


1020 


cfx arcst + 1 


GP 


1920 Ida #$5a 




LP 


130 opm 


DC 


^030 


dy #$ff 


LA 


1930 sec 




CA 


140; 


LH 


1040 ,find quadrant and angle ihela 


IB 


1940 sbc Ihela ;(90'-the1a) 




MA 


150; 


KF 


1050 Ip2 


iny 


NG, 


1950 tay 




GN 


160, 'hires" variables by g.kiziak 


FK 


1060 


sec 


AD , 


1960 pa 




KN 


170x1 ^ $c027 ;curreri1 position 


EL 


1070 


sbc #$5a 


GH 


1970 byt$2c 




MP 


180yl = Sc029 


DF 


1080 


bcs fp2 


NK 


1980calcsin Idy ihela 




AG 


190 -(2 = $c02b ;new position 


JP 


1090 


dex 


BD 


1990 six $15 ;hibyt 




OB 


200 y2 = $c02d 


BP 


1100 


bpl Ip2 , y = quadn (0-3) 


FM 


2000 Idx sine,y 




GJ 


2 1 xc = $c02t ;circ centre (also box) 


OL 


1110 


adc #S5a 


GL : 


2010 calc six $22 




GF 


220 yc = Sc031 


DA 


1120 


sta Ifieia ;(0-90deg) 


AA 


2020 Sta $14 ;obyt 




Kl 


230 hm = $c035 :hires/rnulti ftag 


BC 


1130 


tya 


JN 


2030 Ida #0 




GG 


240; 


NE 


1140 Isr 




PL 


2040 sia $23 




AH 


250, 


MP' 


1150 


bcc fp3 


AN 


2050 idx #8 ;16bit-fract 




BL 


260 , 'hires" internal subroutines 


OP 


1160 


Ida nSa 


OK 


2060 cal2 Isr $22 




PM 


270 igeti ^ Scl 7c ;internaJ get integer 


DB 


1170 


sec 


EO 


2070 bcc cal3 




O 


280iege1 = Scl 87 ;(nlefnaleal&gelx,y 


\F 


1180 


sbc Ihela 


GJ 


2080 CC 




IK 


290 move = $c26e ;'move' rm 


AJ 


1190 


sta Iheta 


GK 


2090 adc $14 




PB 


300imov = $c27l ,jnternalmovetoxl,y1 


NM 


I200lp3 


tya <■ 


AL 


2100 pha 




BK 


310 ipit = Sc375 ;JnteTnal plot 


DJ 


1210 Isr 




HM 


2110 Ida $23 




kJ 


' 320 idrw = $c42b ;interna1 drawlo 


NJ 


1 220 Isr 




HM 


2120 adc $15 




AM 


330; 


■ CI 


1 230 ror 




JB 


2130 sia $23 




Fl 


340 ;zero page labels 


CM 


1240 


sia ysign 


EO, 


2140 pla 




FG 


350theta = $57 ;theangfe(0-90deg) 


JJ 


1250 


tya 


MA 


2150cal3 Isr $23 




AF 


360ysign = $58 ,dependenl on quadrani 


PH 


1260 


and #3 


EC 


2160 ror 




KM 


370xsign = $59 : ' 


FB 


1270 


beq Ip4 


BD 


2170 dex 




CP 


380; 


Bl 


1280 


sec 


HH 


2180 bne cal2 




IM 


390 - = $8000 ,423 bytes 


LA 


1290 


sbc H3 


HA 


2190 Sia $22 ;resloin,a 




GA 


400; 


MH 


1300lp4 


sta xsign 


NH 


2200 Idx $23 




GO 


4l0xf worO ,xradius 


GK 


1310;doyr 


fsin(lhela) 


DF 


2210 rts ;reshiin x 




DP 


420 yr worO ;y radius 


Nl 


1320 


Ida yr 


CC 


2220; 




BM 1 


430 arcst wor ;arc start (deg) 


FL 


1330 


Idx yr+l 


KO 


2230 sine = > ;tab e of sines (0-90 deg) 




MEI 


440 arcend wor 360 ;arc end angi (deg) 


; *"' 


1340 


jsr calcstn 


1 

ON 


2240.byt$00,$04,$09,$0d.$l2,$l6,$1b,$lf 




KK ■ 


450dena .byl5 , polygon focr fdeg) 


'CF 


1350 


Idy ysign 


OA 


2250.byt$24,$28,$2c,S31,$35,$3a,$3e,$42 




CE 


460, 


PE 


1360 


jsr absv .cheeky sign 


LF 


2260.byt$47,$4b,$4f, $53,$58,$5c,$60,$64 




HD 


470 , subroutine gel angle (deg) integer 


AN 


1370 


GlC 


ME 


227O.bvl$68,$6c,$70,S74,$78,$7c,$eO,$84 




JP 


480 ;accL[racy to 1 deg (hex 5a = 90deg) 


NJ 


1380 


ado yc 


NB 


2280,byt$88,$Bb,S8f, S93,$96,$9a,$9e,$al 




BK 


490 getan pha ;save ace 


BN 


1390 


sia y2 


ML' 


2290.byt$a5,$aB,$ab.Sat, $b2.$b5,$b8,$bb 




CP 


500 isr S0079 


MC 


1400 


txa 


GA 


2300.byl$be,$c1,$c4,Jc7.$ca,$oc.$cf, $d2 




NG 


510 beq nomore 


NH 


1410 


adc yc + 1 


BM 


2310 byl$d4,$d7,$d9,$db,$de,$e0,$e2,$e4 




LJ 


520 |sr $aefd ;eatV 


BL 


1420 


sta y2 + l ' ■ 


F 


2320 .byl$e6,$ea,$ea,$ec,Sed.Sef, $f1, $12 




CD 


530 cmp#"," 


J8 


1430;doxi 


'.cos(iheta) ' 


MB 


2330 byt $13. $15, $16, $f7, $18, $19, $ta, $fb 




HI 


540 beq nomore ;anothej",'l *'" 


EA 


1440 


Ida xr 


GK 


2340 bytSIc, $fd, $1e, $le, $ff, $ff. $tl, $ff 




CN 


550 pla ;throw away ace 


MC 


1450 


Idx xr + 1 "^-^ 


GP 


2350 byi $ff, $11, $ff 




HD 


560 jmp igeli ;gel integer to a & .x 


MP 


1460 


jsr calccos 


OK 


2360; ■ 




CJ 


570 nomore pla 


JM 


1470 


Idy xsign 


OB 


2370 end 




nw Transactor 




42 


January 1986: Vblume 8, Isnw 04 





- '^^ M. 



I 4 



-. ^ I 



' 4 



Inside C 1 28 CP/M: 
Supporting More 
Foreign Disk Formats 



I L ■' I ^ 



>''.^ 



Mike Garamszeghy 
Toronto, Ontario 



Hlil U, !■ 



,] ■;'! !"-■'■ 



^». 



=~l 1 1 



I ^ 



-J t^"^ 



. : .you can easily add support for virtually any CP/M disk format. . . 



ti 



One of the nicest features of C-I28 CP/M mode is iis ability to read 
and write "foreign" disk formats infien used with a 1571 disk drive. 
This ability is built right into the operating system, so no special user 
programming is required to access this feature. In addition, with o 
bit of know/edge of disk formats, you can easily add support for 
oirtuaify any CP/fi4 disk format. You can even create custom 
formats of your own to keep your data away from prying eyes. The 
secret lies in knowing how the CP/M operating system recognizes 
different formats. 

Disk Organization 

In order to understand CP/M dusk operations, a brief discussion oi 
disk organization is in order. The user area of a CP/M disk is 
typically divided up into a number of files. Disk space for files is 
doled out by tlie operating system in lumps called "blocks" or 
'"allocation units" of a fixed size, typically 1 024 bytes for single sided 
disks or 2048 bytes for double sided disks. Even if a file contains 
only 1 byte, an entire allocation unit will be required. Unused space 
in an allocation unit cannot be used by other files, but can be used 
by the file to which it is assigned if more space is required for it. (To 
complicate matters, the allocation unit size does not depend on the 
physical disk sector size, but fortunately none of this is of concern to 
the casual user). 

Each allocation unit is further divided into 1 28-byte chunks called 
"records \ The record is the smallest directly addressable part of a 
file. As a file grows (such as by editing a text file), records are added 
as required. If all space currently allocated to a file is taken up, 
another allocation unit is allocated. (8 records can fit into a 1024 
byte block, or 16 in a 2048 byte block size}. A single directory entry 
has space for 1 6 allocation units; if more are required extra directory 
entries or "extents" are created for the file, each taking up 32 bytes 
of space in the directory area. The directory entry keeps track of the 
current record count so that space can be added or deleted as 
required. 

r 

Each allocation unit is composed of one or more physical disk 
sectors. The translation between logical allocation units and physi- 
cal sectors is handled by the CP/fvl system using a "translation 
table" called the DISK PARAMETER TABLE- This contains the data 
required to convert logical records and allocation units into physical 
locations on the disk and is completely transparent to user pro- 
grams, which see everything in terms of standard allocation units 
and records. The different physical disk formats obviously require 
different values for the translation parameters. Once these values 
are set for a given disk format, the user need not be concerned with 



,1^1 



-,."1 ji 



ii ' 



,x-- 



what the physical disk format is because all disk operations will be 
adjusted automatically. 

I J - 

The Disk Parameter Table 

Information on the disk formats is stored in an area of the CP/M 
BIOS(or Basic Input/Output System) known as the "DISK PARAME- 
TER TABLE" or DPT The absolute location of the DPT depends on 
which version of the CP/M operating system is being used. Three 
versions are currently in use on the C-1 28, differentiated by the date 
displayed on the CP/M boot up screen. For Ihe "1 Aug 85"' version, 
the DPT is located from $d876 to $da75 in BANK 0. For the "6 Dec 
85" and "8 Dec 85'^ versions, it is located at $d6bd to $d8bc. Table 1 
is a hex dump of the DPT It is difficult to examine this from CP/M 
mode because it resides in BANK 0, while most programs which 
allow you to examine memory in CP/M mode work in BANK 1. (In 
CP/M, BANK is used for the operating system while BANK 1 is 
generally the user work space or "TRANSIENT PROGRAM AREA" 
(TPA)). You can examine it easily though by using the C-128's 
MONITOR command in the following way: Boot up CP/M. When 
you get the CP/M prompt ("A>"), remove the CP/M boot disk then 
press the <CONTROL> - <ENTER> key combination. (The <EN- 
TER> key is the one at the extreme right of the keyboard in the 
numeric keypad. It is NOT the .same as the <RETURN> key on the 
main keyboard). This performs a soft reset and gets you back into C- 
128 BASIC 7.0 mode. From there you can use MONITOR'S M 
command to display the memory. 

As you can see, each entry is 32 bytes long and only 9 of the 16 
spaces are actually used. The 7 unused spots at the end of the table 
can be identified by the word "None" in the disk name field. These 
spots (or any of the other spots, if you do not wish to keep the disk 
format that it represents) can be filled with custom values.. 

Each of the bytes in a disk parameter table entry has a specific 
meaning. These are outlined below. Many of the parameters are 
repeated in a number of spots in each DPT entry. This is for 
convenience sake as different parts of the CP/M operating system 
use the information in different ways. For clarity, the bytes in each 
entry are numbered from to 3 1 . Bits are numbered 7 6 5 4 32 10. 
with 7 being the high bit and being the low bit. 

Byte is the root to the "problem" of recognizing a foreign disk 
format. It can be called a "media descriptor byte" because it is used 
to identify the physical format of the disk. It is this byte which gets 
compared when a disk is first read. If two or more entries in the DPT 
have identical values here, the disk format selection box will appear 






The Transactor 



43 



January 1988: Volume 8, Issue 04 



on the boUom of the screen asking you to choose the correct formal. 
Although it is perhaps the most important, this byte is also very 
poorly documented (until now), (The only vague reference to it in C- 
128 documentation is on page 707 of the C-128 Programmers 
Reference Guide where it is given in cryptic terms such as 
■'S256*2 + (l6*2-8}+iy'. Each of the bits in the byte serves a 
specific function: 

Bit 7 is flag which indicates whether or not to skip track Oof the disk 
during an initialization. If it is set to (the normal value), it means 
that track of the disk is the same as the rest of the disk. If it is set to 
1 , track has a different format from the rest of the disk. This may 
seem strange, but many MFM disks (such as Epson QX-10) are 
formatted differently, typically in single density, on track than on 
the other tracks to maintain compatibility with much older disk 
systems. ' . ^ 

Bits 5 and 6 indicate the sector size as follows: 

I 5 6 Sector size 

0= 128 bytes 

1 =256 

1 - 512 

1 1 = 1024 

Bits 1 to 4 give an indication of the number of sectors per track. It is 
actually the binary representation of: 

(#sectors/track) - 4 



Some typical 


values 


are: 
















4 3 


2 


1 


sec tors /track 




4 










1 


5 


= (l) + 4 




X 




1 








8 


= (4)+4 




■ 




1 





1 


9 


= (4+l} + 4 








1 


1 





10 


= (4 + 2)+4 








i 1 








16 


-(8 + 4)+ 4 








1 I 


1 





!8 


= (8 + 4 + 2)4 


4 



Finally, bit gives the minimum sector number on side 0, If the 
value is 0, then sectors are numbered starting at 0. If bit is set to 1 , 
the sectors start at L 



r \j 



Byte 1 is called the Disk Type Byte. It gives additional data on the 
logical structure of a disk. This byte is described at the bottom of 
page 717 of the Commodore 128 Programmers Reference Guide, 
The bits have the following meaning: 

Bit 7 describes the disk type: 1 = MFM or = GCR. This is always 

set to 1 for foreign disk types. ^ . ■ 

-,.. - \' ■ - . . 

Bit 6 gives tells how the sectors on side 2 of a double sided disk are 

numbered: i ... 



I ^ I 



= both sides numbered same 

1 = side 2 continues from side 1 



I ^if 



For single sided disks, the bit should be set to 0. lBM-8 is an example 
of bit value set to 0. The sectors on both sides are numbered from 1 
to 8. Kaypro IV is an example of the second side continuing from the 



first. The sectors on the first side are numbered from to 9 while the 
sectors on the second side are numbered from 10 to 19. 

Bits 4 and 5 give the sector size, as outlined above for bits 5 and 6 of 
byte 0. 

Bits 1 to3determinelheorder in which a double sided disk is filled- 
For a single sided disk, the bits should all be set to 0, 



3 2 1 



fill track by track, first side then side 1 of same track then 

next track - - 

1 fill track by track, even track *"s on side 0. odd on side 1 
1 fill all side then side 1 



^ - 



^ t, . 



Bit is a repeat of byte 0, bit as described above, ,^,,. 



I - 



fcv 1 



Bytes 2 and 3 are not normally used. They represent a pointer to a 
sector skew table. The MFM formats supported by C-128 CP/M do 
not use a software skew. Sectors are filled in numerical order on a 
given track such as 1 . 2, 3, etc. In this case, these bytes are set to 0. If 
a skew table were used, bytes 2 and 3 would point to a table 
containing the order in which the sectors are filled such as, 1 , 4, 7, 2. 
etc. This table is often located in unused entries in the disk 
parameter table, but can be located anywhere in BANK RAM, [t is 
difficult to set up without a detailed knowledge of both the disk 
organization and a CP/M memory map for the specific CP/M 
version that you are using. Fortunately, it is not normally used 
except for some really weird disk formats such as OSBORNE 
OSMOSIS and Cromemco. 



4 -l 



:.'■•*< *r. 



Bytes 4 to 20 represent a standard CP/M + DPT entry as described 
on page685 of theC-128 Programmers ReferenceGuide, , . 

Bytes 4 and 5 are referred to as the SPT. This is the total number of 
128 byte records per logical track. It is a 16 bit word coded in low 
byte/high byte format. The size of the logical track depends on both 
the physical format of the disk and the order in which it is filled. For 
example, a single sided disk with 8 sectors per track, each 512 
bytes, would have 32 records per track. A double sided disk of the 
same physical format may have either 32 (if the logical track 
includes only one side of the disk) or 64 (if the logical track includes 
both sides of the disk) records per logical track, depending on how 
the disk was filled (see bits 1 to 3 of the disk type byte). 

. ' ~ I ■- ' I 

Byte 6 is called the BSH or block shift factor. It is equivalent to the 
logarithm in base 2 of the number of 128 byte records in a disk 
allocation unit or LOG 2 (BLS/128). Values are given below. 

Byte 7 is the BLM or block mask. It is equal to 1 less than the 
number of 128 byte records in an allocation unit or (BLS/128) - 1. 
Values for BSH and BLM are: 



-.1. i 



BLS (Allocation unit size) BSH BLM 



X I 



f," 



I J 



4 I 



i^: tj. 



It- T1 



1024 , 


■:,'M,^3;■ 


7 


2048 , ^ 


. ,-. 4 


15 


4096* ■ 


l"^ 1 '"'1 " 


31 


8192' 


. ■,■ ,■ ft 


63 


16384- 


1 


127 



rii,:t" 



Note: Block sizes marked with * are not normally used in floppy 



The Transactor 



January 1966; V6lumd 8, Issue 04 



disk systems. For disks with capacity of greater than 256 k bytes, a 
BLS of at leasl 2048 must be used. 

The allocation unit size (BLS) is not a direct entry in the DPT but is 
calculated by the operating system from the BSH and ELM values. 

I I 

Byte 8 is the extent mask or EXM. This is equal to the maximum 
number of 1 6 k file extents thai can be coded into a single directory 
entry. The maximum values are given below. Values of less than the 
maximum can be used, but this wastes directory space as some of 
the available spots in the file allocation table will not be used. A 
value of must be used for disk systems which run under very old 
versions of CP/M. (For example, if you want to support a disk format 
that runs on a CP/M 1 .4 machine.) ' ■ 



BLS 


Typical EXM 




DSM<256 DSM>255 


i024 





2048 


1 


4096 


3 I 


8192 


7 3 


16384 


15 7 



Bytes 9 and 10 are a 16 bit word (DSM) representing the total 
number of allocation units on the disk including the directory area, 
but excluding reserved system tracks (if any). The bytes are in low 
byte/high byte format, DSM can be calculated from: 

(net # tracks} • (# sectors/track) / (# sectors/allocation unit) 

where (net * tracks) is the total number of tracks on the disk minus 
the reserved system tracks. 

Bytes 1 \ and 12 (DRM) are the total number of directory entries on 
the disk minus L For single sided floppy disks, the number of 
directory entries is usually 64 and for double sided disks is 128. 
Therefore, byte 1 1 is usually either $3F (63) or S7F (127) while byte 
12 is normally 0. 

I 

Bytes 13 and H (called ALO and ALl) give the number of blocks 
which are reserved for directory use. This is an inverted 16 bit 
number of the following formal: . i 

< — Byte 13 — X — Byte 14 — > 

Bit 7654321076543210 

Position 0123456789ABCDEF 

^ , - 

Each position which is set to I (starting at position 0) indicates one 
allocation unit reserved for a directory block. Typically, this results 
in bits and 1 being set, giving a value of $C0 for byte 1 3 and for 
byte 14. ' 

Bytes 1 5 and 1 6 are called the directory checksum vector. CKS. The 
16 bit value is equal to (DRM + l)/4. For 64 directory entries, byte 
15 has a value of $10 (16), while for 128 directory entries it has a 
value of $20 (32). !n both cases, byte 1 6 has a value of 0. ■. ^. '' 

I » 

Bytes 17 and 18 give the track number of the first directory sector 
(OFF). This is used for disk partitioning and to skip reserved system 
tracks at the beginning of the disk. Byte 1 7 is typically in the range 
of 1 to 4, while byte 18 is normally 0. To create your own custom 



disk format which uses all of the disk, set both bytes to 0. 



i - 



Byte 19 is the physical sector shift factor or PSH. It is equal to: 



^'^ 



LOG2([secfor-Sf2e]/128), 



Values are given below. 



-J - 



Byte 20 is the physical sector mask or PHM. It is equal to: 



-II 



-n 



[sector-size]/ 128-1 



] ^ 



J h 



Physical sector size PSH PHM 



t I'Vi.if 



Oi'> -rf'fi^&'j'.'l 'f^-jtV .V-'''fm\ \'t\ 



f*. 



-' 



h ' • 



I ' -1 J I 



ii - 



128 bytes 








256 bytes 


1 


I 


512 bytes 


2 


3 


.'1024 bytes 


3 


7 


,f" ', -i.- 1 j--fi]< ■ 


J 


4 



t ' 



T ■ f 



M ■ 



Bytes21 to31 are not part of a standard CP/M disk parameter table 
but are used by the C-1 28 version of CP/M. Byte 21 is the number of 
sectors on a physical track. Bytes 22 to 31 are an ASCII text string 
describing the disk name. This is the name which pops up in the 
disk selection box at the bottom of the screen when the system 
cannot decide what the format is. Otherwise, it is not used. 



.r. 



L''_;l 



\ - 



Customizing your DPT 



M) 



What purpose does all of this detailed technical info serve, you ask? 
Well by playing with the values, you can get your C-128 CP/M to 
read and write the disks from your uncle Fred's ancient CP/M 

machine or you can create your own CP/M disk formats that no one 
else can read to protect your data. {Dear Diary — ) 

The easiest way to change the DPT is by editing the CPM + .SYS file 
with a debugger utility such as S1D.COM to load the CPM -f ,SYS file 
into memory, then change the individual bytes, and save the 
modified file. Each time you boot up CP/M in the future, you would 
have automatic support for these other disk formats. This is identical 
to the method described in the article XP/M and the 1581 Disk 
Drive" in Transactor vol 8, Issue 3 (Nov 87). You could also change 
the parameters in RAM once the computer has been booted, but 
remember they are stored in BANK RAM and will require special 
programming in a common area to do this. Try high RAM location 
starting at $fe00 for the location of such a program. This area is 
normally used as a disk buffer and is free for non-disk 1/0 prt^rams 
which need common BANK 0/BANK 1 memory. Changing the 
parameters in RAM is only a temporary measure, while changing 
the CPM + .SYS file is permanent. Take your pick. -. ^ 

The locations of the seven unused disk parameter table entries in 
the CPM + .SYS file when using SID are as follows: 



I- 



O- 



^ I 



IL 



I Aug 85 version 


6 Dec or 8 Dec i 


"""■ $1976' 


$lefd 


■ $1996' '■ 


"' '^'" " $l[ld 


-■ $19b6 ' 


' '■'/ '- $lf7d 


$l9d6 


$lf9d 


siaie 


$lfbd 


$la36 


$lfdd 


$la56 


$205d 



The Trantactor 



45 



January 1986: Volume 8, Issue 04 



The end of file (EOF) for the Aug version is $5d00, while for the Dec 
versions, tt is $6400. These numbers will be needed later when re- 
writing the file. You should always use a backup work disk when 
doing these changes because your CPM + .SYS file will be changed 
permanently. Do not modify your original system disk!!! 

The disk parameter table entries begin at the bytes specified above, 
according to the byte parameters previously described. Select an 
unused spot then use SID's 'D' command to display the memory at 
that location. For example, dl976 <return> will display memory 
starting at $1976. If the display does not vaguely resemble the 
format of table 1. then stop because you do not have the correct 
memory area. (Check to see that you have the correct version o CP/ 
M then try again). These locations can be changed using SID's 'S' 
command to the values for the new formats that you wish to 
support. Once the file has been changed, it can be saved again 
using SID s W command (w cpm+.sysJ00,(EOF valueKfelurn> 
where (EOF value} is the one listed above for your CP/M version). 
For a description of how to use these, see the article mentioned 
above. Inordertouseyour new format, you must do a cold reset (i.e. 
push the reset button or <CONTROL>-<ENTER>. 



Table 2 contains the values for several disk formats which I have 
added to my system. The MAXI-71 and MAXI-8i formats are ones 
which I invented myself that take advantage of the full disk capacity 
(about 396 k for 1571 and 796 k for 1581), These two formats use 
1024 byte sectors, double sided, 5 sectors per track, numbered Oto 
4. 



\f'\:/--' 



• < ■ 



I H 



T-^ 1**. >^i ^'j J I 



I ( 



.^n I..,-.. 



■?'- 



To create disks for these new formats, you will need to use the burst 
mode format command from C-128 mode. For the 1581, the 
command is: ■■ , i 



" \j^'^^^ 



- I 



open 15,8,15 l*!/. > ^1= n' ' jt vj: i'-j.-.* v' ' '-^ h u, .'j;tj;v 

print#15,"u0" + chr${134) + chr$(3} + chr$(79)4'ChrS(5) 

+ chr$(0) + chr$(229) + chr$(0) ^ ' 
close 15 

I 
I ■ '.hi 

For the 1571, theprint*15 command is: 

prinWI 5,"uO' + chr$(102) + chr$(1 28) + chr${0) + chr$(3) 
+ chr$(39) + chr$(5) + chr$(0) + chr$(0) + chr$(229) 



Table 1: The unmodified C-128 CP/M disit parameter table 

>0D876 39 91 00 00 40 00 04 OF 01 97 00 7F GO CO 00 20:9 . . .@ '._-:®'r 

>0D886 GO 02 GO 01 01 10 45 7G 73 6F 6E 20 51 58 31 30 : Epson QX 1 

>aD896 CD A1 GO 00 50 00 04 OF 01 BD 00 7F 00 CO OG 20 :M ! . . P . ...=._.©. 

>0D8A6 00 02 00 02 03 OA 45 7G 73 6F 6E 2G 51 58 31 30 : Epson QX 1 

>0D8B6 49 A5 00 OG 20 00 03 07 OG 9B 00 3F 00 CO 00 10 : I % ? . @. . 

>0D8C6 00 01 00 02 03 08 2G 49 42 4D 2D 38 20 53 53 20 : I BM - 8 S S 

>0D8D6 49 A5 00 00 20 00 04 OF 01 9D GO 3F 00 80 00 10 : I % ? . . , . 

>0D8E6 00 01 00 02 03 08 20 49 42 4D 2D 38 20 44 53 20 : I BM - 8 DS 

>0D8F6 4C E2 OG 00 28 00 04 OF 01 C4 00 7F GO CO OG 20 : L b . . ( . . . . D . _ . @ . 

>0D906 OG 01 OG 02 G3 OA 4B 61 79 50 72 6F 20 49 56 20 : Ka y P r o IV 

>0D916 4C EG OG 00 28 00 03 07 00 C2 00 7F 00 FO 00 20 :L@, . ( . . . . B . _ . p . 

>0D926 00 01 00 02 G3 OA 4B 61 79 50 72 6F 20 49 49 20 : K a y P r o II 

X)D936 63 B1 OG GO 28 00 G3 07 GO B8 00 3F 00 CO 00 10 :c 1 . . ( . . , . 8 . ? . @. . 

X)D946 00 03 00 03 07 05 4F 73 62 6F 72 6E 65 20 44 44 : Osborne DD 

>0D956 4B A3 00 GO 2G 00 G4 OF G1 9D 00 3F 00 80 GO 10 :K# ? . . . . 

>0D966 OG 01 00 G2 03 08 20 20 53 60 69 63 65 72 20 20 : S I i c e r 

>0D976 39 91 00 00 40 00 G4 OF G1 8F 00 7F OG CO GO 20 :9 . . . @ ^ . @. 

>0D986 00 04 00 G1 01 10 45 70 73 6F 6E 20 45 75 72 6F : Epson Euro 

>0D996 FF 8G 00 GO 5G 00 G4 OF G1 BD 00 7F 00 CO 00 20 :_ . . . P . , . ,=._.©. 

>0D9A6 00 02 00 02 03 08 20 20 20 4E 6F 6E 65 20 20 20 ; None " 

>0D9B6 FF 80 00 00 50 GO 04 OF 01 BD OG 7F OG CO GO 20 :_ . . . P . . ..=._. 

>0D9C6 00 02 00 G2 03 08 20 20 20 4E 6F 6E 65 20 20 20 : None 

>0D9D6 FF 80 00 00 50 00 04 OF 01 BD OG 7F 00 CO 00 20 :_ . . . P . . . . -'.' _ . 

>0D9E6 00 02 GO 02 03 08 20 20 20 4E 6F 6E 65 20 20 20 : None ' -■ 

>0D9F6 FF 80 00 00 50 GO 04 OF 01 BD 00 7F 00 CO 00 20 :_ . . . P . . ..-,_, 

>0DA06 00 02 GO 02 03 08 20 2G 20 4E 6F 6E 65 20 20 20 : None 

>0DA16 FF 8G 00 00 50 00 04 OF 01 BD 00 7F 00 CO 00 20 :_ . . . P . . ..=._. 

>0DA26 00 02 00 02 03 08 20 2G 20 4E 6F 6E 65 20 20 20 : None 

>0DA36 FF 8G 00 GO 50 00 04 OF 01 BD 00 7F 00 CO 00 20 :_ ... P ....=._. @. ■* 

>0DA46 00 02 00 02 03 08 20 2G 20 4E 6F 6E 65 20 2G 20 : None' " 

>0DA56 FF 80 00 GO 50 GO 04 OF 01 BD 00 7F GO CO 00 2G :_ . . , P . ,' . .=._.©. 
>0DA66 00 02 00 02 03 08 20 20 20 4E 6F 6E 65 20 20 20 : None 

i< • ; 

Note; The address range given above is for the ^'1 Aug 85" version of the CPM + . SYS file. 

The "6 Dec 85" and "8 Dec 85" start at address $0D6BD. ^ ■ ' 

1 1 1 ■ I I 



•T.i. 



\-m 



. H 



f^ , - + 



^ _ ' 



1 J 






The Transactor 



44 



January 1986: Volume B, Issue 04 



Table 2; Disk Parameter Table values for selected new disk formats. (Note: all values are in tiex) 



^-d 



Byte- 


tf -4 




Disk Format 






XEROX 16-8 


OLYMPIA ETX 


OLYMPIA EXIOO 


TELEVIDEO 


MAXI-7i 


MAXl-81 


m* 


DS 


SS 


DS 


DS 


DS 


DS 





4b 


4b 


4b 


3d 


62 


62 


1 


1 a5 


aS 


a3 


91 


'^^■" bO - 


... .^,. 


2 


1 

00 


00 


00 


.. 00* 


00 


= 00 


3 


00 


00 


00 


00 ;i;-^- 


00 .. ^ 


, -t .^'-v jAIW'fc-^^ -^>^ FJ 


4 


24 


24 


24 


48 


50 


50 


5 


00 


00 


00 


00 


00 


00 


6 


04 


03 


04 


p4 


04 


04 


7 


Of 


07 


Of 


Of 


Of 


Of 

1 


8 


01 


00 


00 


00 


01 


; 00 


9 


ae 


9b 


ae 


bd 


c8 


90 

1 


10 


00 


00 


00 


00 


00 


1 01 


11 


3f 


3f 


7f 


7t 


7f 


71 


12 


00 


00 


00 


da 


Ti,. 00 \ 


. :,, 00 ■■"■ ■ 


13 


80 


cO 


cO 


' i:' -oOr "■ 1 


cO 


cO 


14 


00 


00 


00 


III, .O&l. i;. 


00 ,M, ; 


-■*! ;., iiOQliLv . 


15 


10 


20 


20 


20 


20 


. ,r20 


16 


i 00 


00 


00 


00 


00 


■' 00 


17 


02 


02 


02 


02 


00 , , 


00 


18 


00 


00 


00 


00 


; ■■ ■ ^ ■...i.n 


" ' ''' ' ■ftv"-'"^'^"'''-' - 


19 


02 


02 


02 


01 ■ ' 


03 ■■ ' 


03 


20 


03 


03 


' 03 


01 


07 < 


■','07f; ■-'■.' 


21 


09 


09 


09 


12. r ■ 


05 , . 

1 


■■1' -fi&K: .■'.■■'. 


22 


58 


65 


4f 


54 


4d 


4d 


23 


65 


74 


2d 


65 


61 


61 


24 


72 


78 


45 


6c 1 


78 


78 


25 


6f 1 


20 ■ 


58 


■■65 


69 ■ 


■ 69 


26 


78 


49 


20 


76 ' 


.,.,1 20 ■ ^ ■ 


20 


27 


20 


49 


31 


.69' 


37 


-38 -"■ 


28 


31 


20 


30 


64 


31 


„ -vai-i 


29 


36 


20 


30 


65, 


20 

1 


, 20 


30 


2d 


20 


20 


6f 

> 


20 


1 ' 


31 


38 


20 


20 


20 


20 



if'f.. 



-1 



\ II 



I"* 



Byte" 


Disk ForiTial | 


MCR-DM 


Zenith 


Zenilh 


Zenith ' 


TRS-80 IV 


LOBO max 




DS 


Z90SS 


ZIOO DS 


ZIOOSS 


SS . .. 


, SS ., . 





49 


39 


49 


49 


49 


3c 


1 


aS 


91 


a3 


al 


al 


90 


2 


00 


00 


00 


00 


00 


00 


3 


00 


00 


00 


00 


00 


00 


4 


20 


20 


20 


20 


20 


24 


5 


00 


00 


00 


00 


00 


00 


6 


04 


03 


04 


04 


03 


03 


7 


Of 


07 


Of 


Of 


07 


07 


8 


01 


00 


00 


00 , 


00 


00 


9 


99 


97 


, 9b 


97 


9b , 


. ^ 


10 


00 ^ 


00 


1 

00 


00 


00 


00 


11 


7f 


7f 


ff 


7f 


3f 


3f 


12 


00 


00 


00 


00 


00 


00 


13 


cO 


K) 


fO 


fO 


cO 


cO 


14 


00 


00 


00 


00 


00 


00 


15 


20 


20 


40 


20 


10 


10 


16 


00 


00 


00 


00 


00 


00 


17 


03 


02 


02 


02 


01 


03 


18 


00 


00 


00 


00 


00 


00 


19 


02 


01 


02 


02 


02 


01 


20 ' 


03 


01 


03 


03 


03 


01 


21 


08 


10 


08 


08 


08 


12 


22 


4e 


48 


48 


48 


54 


4c 


23 


43 


65 


5a 


5a 


52 


6f 


24 


52 


61 


20 


20 


53 


62 


25 


20 


74 


31 


31 


2d 


6f 


26 


20 


68 


30 


30 


49 


20 


27 


20 


20 


30 


30 


56 


20 


28 


; 20 


39 


20 


20 


20 


20 


29 


20 


30 


. -^-^ , ,-i 


, . :, >5a ,. 


. ' 20 


20 


30 


20 


20 


1 J 

53 


53 


.. 20 , 


20 


31 


20 


20 


20 20 


20 


20 






The Transoctor 



47 



January 1988: Vblume 8, Issue 04 



\- ■ 



\. 



-, f'-.- 



CP/M3.0: 
Plus Redirection 
and Batch Processing 



J*? 



The last in Ihe lineage of CP/M for 8 bit computers, CP/M 3.0 was 
enciowed with a name, CP/M Plus, along with its inherited number. This 
article deals with one of the pluses of CP/M Plus, input/output (I/O) 
redirection and batch processing. 

We are creatures of habit. Introduced to a computer system with the 
keyboard as the input source and the screen or prititer as the output 
destination, we accept this configuration as the natural order. It isn't, A 
more flexible conception of an input source and an output destination is 
possible. The following example illustrates the benefits. 

If you're like me, your collection of programs has grown far beyond your 
capacity Co remember which files are on which disks. Labelling the disks 
with the contents is an obvious solution. Using the DIR command to 
obtain a list of the files on each disk, then printing it onto a label is the 
simplest procedure to follow. But wait - to print the label for the disk 
you'll have to copy the DIR listing down by hand, enter each list into a 
text editor, format the file for printing and then print it out- There is a 
tietter way. 

If the output from the DIR command could be redirected to a disk tile 
instead of the screen, then you wouldn't have to copy down and re-enter 
the inlormation. If the repetitive text editor commands to format the 
listing for printing could be redirected from a disk file instead of the 
keyboard then you wouldn't have to tweak each listing by hand. I/O 
redirection allows you to do just that. 

Redirection is a standard feature in most current operating systems, OS's 
as varied as AmigaDOS, MS-DOS and UNIX provide redirection capabili- 
ties. Redirection is commonly provided as a command line option - the 
redirection operation is indicated on the command line along with the 
command it is to act upon. Earlier versions of CP/M included limited 
redirection as options with specific programs and redirection of screen 
output to the printer through a tc^gle on the command line. In contrast, 
CP/M Plus provides a limited implementation of true 1/0 redirection in 
addition to these ad hoc capabilities. 

The standard notation to redirect prc^ram output to a file is; 

command > outpuLfile 

The standard notation to redirect program input from a tile is: 



command < inpuLfile 



It shouldn't surprise you to learn that CP/M Plus does not use the 
standard command line notation to implement I/O redirection. Instead, 
CP/M Plus implements I/O redirection with two utility prc^rams invoked 
as commands in themselves. These are: PUT and GET. -~ 



■■ r"r 

X 

I'il 
I' 

■ 

■if- 



AdamHerst 

1 

i 

Toronto, Ontario 

i © Copyright 1987 Adam Hetsl 



}j'. 
'T.* 

L^ 



LI' 



PUT 



i" 

■r,- 
^■^ 

T. 

■ h) 
!i\4 



^ 

r 

■ '\ 
li 



PUT is a transient command invoked on the command line. It causes the 
output of subsequent programs to be redirected to the named disk file. 
Output destined for the screen and output destined for the printer can be 
placed in a file with the PUT command. Since PUT is a transient 
command it must be on a logged-in disk in an accessible user area to be 
executed- 



' I- 

1 1 
1 1^ 



There are four variations of the syntax for the PUT command. Two are 
related to screen redirection while the other pair is used for printer 
redirection. The syntax to redirect the printer output of subsequent 
pni^rams to a file is: - ■ ■. ' 



PUT PRINTER OUTPUT TO FILE filename.typ 



This can be abbreviated to: 



^T-- 



PUT PRINTER FILE filename } 

(This abbreviation holds for all four variations of PUT and will be used for 
the remainder of this article.) The syntax to restore the direction of 
program output to the printer is: 

PUT PRINTER PRINTER 

To redirect the screen output of subsequent programs to a disk file the 
syntax is: 

PUT CONSOLE FILE filename.typ 

(CONSOLE, abbreviated to CON for some programs, is a special name 
CP/M uses to refer to the combination of screen and keyboard. When 
used in an output context, it refers to the display screen. When used in an 
input context, it refers to the terminal keyboard.) To restore the direction 
of program output to the screen, the syntax is: 

' ■ PUT CONSOLE CONSOLE - 

By w^ of example, the following commands must be issued to redirect 
the output of the DIR command: 

PUT CONSOLE FILE dirtxt 

r 

{Since PUT is a transient command, remember to have the file PUT.COM 
on a It^ged-in disk in an accessible user area.) CP/M will respond with 
the message: 



I I 



Putting console output to file dirtxt 



The Transactor 



4S 



January 1988: VWume 6, Issue 04 



and attempt a disk access to create the file DIR.TXT. If a file by that name 
exists, CP/M will prompt for confirmation to overwrite the existing file. 
Responding with 'no' aborts the PUT commanti. When the the command 
line prompt returns, issuing the command: 

DIRa: 

sends the output of the DIR program to the file DIR,TXT as well as to the 



PUT CONSOLE CONSOLE 



screen. 



Ill •■ I'. %l " 'l ,H. 



, , I !( I ' I.' ? _-■ ''i I fi i]i ■'■. ■ .'--I'?' . t''.. I 

At this point, the output of subsequently issued commands also would be 
redirected to the file DIR.TXT To direct the output of subsequent 
commands to the screen and to close the redirection file, the command: 

PUT CONSOLE CONSOLE 



should be issued- CP/M will respond with: 

I 

Putting console output lo console 

I 

and close the output redirection file. 

If you had wanted the output of the DIR command to go only to the file 
DIRTXT and not to the screen as well, PUTs NO ECHO option could 
have been used. The syntax to include this and other PUT options is: 



PUT CONSOLE FILE filename.typ [ option_list 



(Note the square brackets surrounding the option list. These must be 
included on the command line,) Other options for the PUT command 
include: ECHO, the default, used to restore echoing after a NO ECHO, 
FILTER, used to translate control characters in the output stream into 
readable form, NO FILTER, the default, used to cancel filtering after 
FILTER, and SYSTEM, used to indicate that redirection should occur 
immediately after the PUT command and include system output as well 
as program output. 

Another, less obvious use of the PUT command is to create files of OK 
length. These files are crucial to the operation of certain programs - 
typically disk catal(^uing programs that require files of OK length to 
function as disk labels- 

A little history is in order Earlier versions of CP/M, up to release 2.2, 
included a resident utility named SAVE. Much like the transient utility of 
the same name provided with CP/M Plus, the earlier version allowed you 
to save blocks of memory lo disk. One quirk in the operation of this 
command was the ability to save blocks of memory, thus creating a file 
OK in length. This quirk was discovered by a number of CP/M hackers 
and incorporated into programs that required the presence of OK files. 

The modifications made to SAVE in creating SAVE.COM included the 
removal of this quirk. Users of CP/M Plus cannot create OK files in this 
way. This inability has given rise to the practice of distributing OK files on 
the disks with the programs that need them! This isn^t necessary. In 
renxiving the capability from one command, the programmers at DRI 
introduced it, knowingly or not, into another. PUT can be used lo create a 
file OK in length. To create a OK file, redirect output to a file with the 
command: 

PUT CONSOLE FILE filename.typ 

-■ .1 ■ 

When the prompt returns, instead of issuing a command, restore the 
directionof output to the screen with the command: ' '' " i'" ■ 



{Interestingly, CP/M responds with: 



i: 
/ 



'i\ 



". \^}- 



Put complete for file: filename.typ 
Putting console output to console 



Since PUT does not respond with the first line in other cases it appears 
that this was an addition to handle an exception condition. You can 
almost smell the paste holding this patch on.) You will be left with a file 
that is OK bytes in length- 



It 



GET 



■ .-. 



- - i 



^'jT,}; K 



'M UHri 



r-^., 



GET is a transient command invoked on the command line to redirect the 
input of subsequent programs from a named disk file. Only keyboard 
input can be redirected using the GET command. The input to the 
prc^ram must have been previously placed in the file. Since GET is a 
transient command it must be on a logged-in disk in an accessible user 
area to be executed. ' ^ 

At this point it may be helpful to differentiate between two kinds of input 
to a program: command input and data input. Practically all programs are 
designed to accept command input from the keyboard as their default, A 
database management system is a good example. It manipulates data 
according to 'command' input. If commands aren't entered, nothing 
happens. The commands entered cause the DBMS to act on "data* input. 
If the data is new data, it must be entered into the database via the 
keyboard. The GET command allows both command input and data 
input to be taken from a disk file. 

The syntax to redirect program output with the GET command is: 

GET CONSOLE INPUT FROM FILE filename.typ 

(Used in this context, related to input. CONSOLE refers to the terminal 
keyboard. Similar to the PUT command, the words CONSOLE INPUT 
FROM can be omitted and the syntax abbreviated to: 



-r^ 



GET FILE filename.typ 



.,, ^,, 



This abbreviation will be used from now on.) Issuing the GET command 
causes the command input for the subsequent pr(^ram to be taken from 
the named file. It is not necessary to issue a command lo restore the 
direction of input from the keyboard. The effects of the GET command, 
issued without options, will end in one of two conditions. If the redirected 
input ends the program, the effects of GET will end with the system 
prompL If the program is not terminated, the effects of GET will end with 
the input redirection file, leaving you in the program. In both cases, other 
programs or commands in the input redirection file, normally issued at 
the system prompt, will not be executed- ■ ■ " ' 



I H 



To execute a series of commands from a disk file, GET s SYSTEM option 
can be used. The syntax for GET with options is: 

GET CONSOLE FILE filename.typ [ optionjist ] 

(Note the square brackets surrounding the optionjist. These must be 
included on the command line.) This will cause all subsequent input, 
both system and prograin, to be taken from the named file immediately. 
The direction of input from the keyboard will be restored when the end of 
the input redirection file is reached or input direction is explicitly restored 
to the keyboard with the command: 



The Transactor 



49 



January 1988: Volume 8, Issue 04 



GET CONSOLE CONSOLE 

We can use GET to aulomale the process of formatting the directory 
listing (put into the file DIR.TXT in our last example) for printing, in 
combination with the line editor supplied with CP/M Plus, ED. (A 
summary of ED commands is available through the on-line HELP 
facilities provided with CP/M Plus. If you are thinking of using ED for 
your general editing needs, be warned that ED is inadequate for interac- 
tive, screen-oriented text editing. It is, however, good for editing an input 
stream in a repetitive pattern.) 



-- f' 



First we must create the file that will contain the predetermined input to 
ED. Place the following input lines into a file called DIR.GET; 



1:#a 

2:b 

3:5k 

4:b 

5; ml3kfDirectory"Z-5k 

6. -b 

7; -3k 

8:b 

9: mfUser"Z-4c0kl-2ci 

10; b 

n : mf*LV-2cOI40ci'L"ZI 

12: b 

13,#s"LV."Z 

14; b 

15:mfUser*Zli "L 

16: b 

17:mf"LV-2cOI20cki"LV 

18: -b 

19:i*L'LT"LV 

20; b 

21;mf''L"Z-2dl-2dl 

22: b 

23: #s'L."Z.*Z 

24; b 

25; mlfUserV-4ci"LV60ci''LV 

26: b 

27; #S"L'L"Z*L"Z 

28; b . 

29;rn$1f"L'Zi"L''Z 

30: e 



A| A 



LV 



Once you have created the file DIR.GET and have put the directory listing 
in the file DIR.TXT, issue the command: 

. . GETCONSOLE FILE DIR.GET 

(Remember to have the files PUTCOM and D]R,GET on a iogged-in disk 
in accessible user areas.) CP/M will respond with the message: 

Getting console input from file dir.get 



Issuing the command: 



ED DIR,TXT 



will invoke ED, causing it to take as its input the command lines in the file 
DIR.GET, (Remember to have ED.COM on a Ic^ed-in disk in accessible 
user areas,) When the end of the file is reached, input will be restored to 
the keyboard. The file DIR.TXT will be formatted at 60 characters to a 



line, suitable for printing on a label with 8 lines per label at 1 7 pilch {132 
characters to a line). The command: 

, " ■ PIP LST = DIR.TXT 

can be used to send the file to a printer. 

You may have noticed a couple of problems with our automation process 
so far. It's not very flexible - there is no way to account for the variations 
in line spacing on labels. The listed version expects labels that hold eight 
lines to a label. More problematic is the presence of control codes in the 
input redirection file for ED. These have been listed in a symbolic 
representation requiring two characters: the caret C^) and the appropriate 
alphabetK character ED will not accept control codes in this representa- 
tion. Control codes must be entered as their ASCII value. While some text 
editors will allow you to insert the literal control code within a body of 
text, most won't. This makes creating the redirection input file extremely 
difficult. Finally, we've only automated one part of the process required to 
produce a label of a disk directory - the formatting. There is no reason 
why the whole process shouldn't be automated. Fortunately, CP/M Plus 
provides batch processing capabilities that are functionally identical to. 
but considerably more sophisticated than the capabilities of GET. These 
are available through the SUBMIT command. 



I K 



\ ^ i^p 



SUBMIT 



iiT 



SUBMIT is a transient command invoked on the command line to redirect 
system and program input from a named file. This sounds similar to the 
capabilities of GET. It is - but SUBMIT approaches the problem from a 
different perspective. While GET was developed to redirect input for a 
single program - the classic definition d redirection - SUBMIT was 
developed to execute a series of prc^rams, GET expects prt^ram input as 
its default while SUBMIT expects system (command line) input as its 
default. While both commands have evolved to accept both kinds of 
input, the capabilities of SUBMIT provide greater flexibility in the form of 
variable substitution and symbolic representation of control codes among 
other features. 



A SUBMIT file comprises a series of commands on separate lines (i,e. 
followed by a carriage return). Issuing the SUBMIT command causes the 
execution of the commands in the named submit file. Since SUBMIT is a 
transient command it must be on a Iogged-in disk in an accessible user 
area to be invoked- To invoke SUBMIT issue the comma:id: ,, , ■ ■ 



.^- 1 



SUBMIT hlename,sub 



The effects of the SUBMIT command terminate with the end of the 
submit file. There are no options for the SUBMIT command. At this point, 
one of SUBMIT's few functional differences from GET becomes apparent. 
GET redirects input directly from the input redirection file. SUBMIT 
redirects Input from a temporary file created from the .SUB file. For this 
reason there must be sufficient free disk space on the current disk. If 
there is not, the SUBMIT command will abort. 

To begin automating the disk labelling process, we can create a submit 
file to put the output from the DIR command into a file for formatting by 
ED. Create a text file called DSKLABEL.SUB containing the lines: 

put console file dirtxt 
dir.txt {user = all nopage] 
put console 



Issuing the command: 



i V!? f! 



'■- 1' 



Jhm Transactor 



50 



January 1988: Vtiume 8, Issue 04 



SUBMIT DSKLABELSUB 

will cause each line in the submit file to be echoed on the command line 
and executed. When ttie end of the submit file is reached, control returns 
to the system prompt, ihe file DIRTXT will contain the directory listing 
to be formal ted. 

As il stands now, this submit file will create a directory listing of the 
l(^ed-in disk. To list the directory of a non-current drive, we would have 
to log-in to it before issuing the SUBMIT command. It would be conven- 
ient if we could specify the disk which is to have its directory listed on (he 
command line when we issue the SUBMIT command. The parameter 
passing capability of SUBMIT allows us to do just that. 

SUBMIT will accept up to nine parameters on the command line. Each 
argument replaces its corresponding variable in the submit file. Variables 
take the form of a dollar sign followed by a digit from one to nine. The first 
argument issued on the command line replaces every occurrence of the 
variable '$1' in the submit file, the second argument replaces every 
occurrence of the variable ^$2' and so on up to '$9'. (To include an actual 
Tin a submit file, use a '$$'.) 

To pass the drive specification of the disk which is to have its directory 
listed, replace the second line of DSKLABELSUB with: 

dirSI [user = all nopage] 

Now when the SUBMIT command is issued it can take the form: 

SUBIVIIT DSKLABEL drive^specitication ^ 

where drive_specification is the drive letter followed by a colon {e-g. a;). If 
the drive specification is omitted on the command line, the variable will 
be replaced by a null value and the directory of the logged-in disk will be 
listed. 

So far we have automated the series of commands to produce the 
directory lishng to t>e formatted. To formal the listing we don't need to 
execute a series of commands, but need to execute a single program 
according to a series of program command input lines. To differentiate 
between programs and prc^ram command input lines in a submit file, 
program command input lines are preceded by a left angle bracket (<). 
Add the lines listed for the file DIR.GET to DSKLABELSUB, preceding 
each with a left angle bracket. Precede these command input lines with 
the command ED. Control codes can be represented symbolically - 
SUBMIT will translate them into literal form before passing them to ED. 
(To represent a real caret, a ^"^^ should be used.) 

We can accommodate the variations in lines per label that is likely to be 
encountered using a second variable in the submit file. (Because the lines 
per label a^ument will always be passed to the submit file we will use 
the variable '$1 ' to represent it. Consequently, the variable representing 
the drive specification must be changed to '$2'. Since the drive specifica- 
tion is the last argument on the command line, it can still be omitted to no 
ill effect,) Finally, we can add a line to the submit file invoking PIP to send 
the formatted directory listing to the printer. 

The complete DSKLABEL.SUB file looks like: ' ' 

■ -- ' ' 

1: erasedir.txt ■ ' ■ 

2: put console file dir.txt [no echo] 
3;dir$2[user = aflnopage] 
4: put console 



f 



5: ed dir.txt 

6:<#a 

7:<b 

8: <5k 

9;<b 

10: <ml3kfDirectory*Z-5k 
1 1 ; <-b 
12:<-3k 
13; <b 

1 4: <mfUser"Z-4c0kl-2ci 

15: <b 

16:<mf'*L"Z-2cOI40cJ"L"ZI 

17:<b 

18:<#S'L.V.V 

19:<b 

20: <mfUser"Zli *L. 

21: <b - . 

22: <mf L''Z-2cOI20cki^LV 

23: <-b 

24; <jA|_A[_»LA|_A2 

25: <b .... 

26: <mf'*LV-2dl-2dl 

27: <b 

28: <#s'L.V.'Z '' 

29: <b ' ■■'' " ■ 

30: <mlfUser''Z-4ci*LV60ci''L*Z 

31; <b 

32;<mf'L'*L"Z''L"Z 

33; <b 

34:<m$1f'^LVi'^LV 

35; <e 

36: pip 1st; = dir.txt 



T T7- 



.*? 



f^\ ., 



vz 



L L *■ ^ 



:: 'i/'V'iT'-'i .'-'^^ ' ' 



*^ 



„ , ■■'■ '■■(::."■ ,h^h 






I in .'i-.riuJi< y'Z 



h 



M, .' 



(The exact number of periods in lines 1 4 and 20 is not important - there 
should be at least 40 in line 14 and 20 in each of the strings in line 20. 
This SUBMIT file generates labels from directories that do not have active 
time/ date stamping, if you use time/date stamping omit lines 1 5 and 1 6,) 



To invoke DSKLABEL issue the command: 



" ,. ♦ 



:, :[;.' 



SUBfvllT DSKLABEL labels^perjine drive_specification 

Where labels_per_line is an integer, drive_specification is a letter fol- 
lowed by a colon representing a disk drive. To create labels with 8 lines 
per label on the disk in drive M:. the command: 



SUBMIT DSKLABEL 8 m: 



1 1 



should be issued, (The drive specification argument may be omitted 
resulting in a listing of the current drive, but the labels per line argument 
must be provided. Failure to do so will result in Itie double spacing of the 
DIR.TXT file.) Before issuing the SUBMIT command, remember to set 
your printer on-line ready to print at 96 or \ 32 characters per line. 

The redir^tion and batch processing capabilities of CP/M 3.0 are not 
ideal. The implementation of redirection in the form of free-standing 
programs is clumsy and unintuitive, although it does allow for the 
presence of command line options. The absence of true variables and 
flov^ of contn^l operators in the SUBMIT environment restricts its useful- 
ness. Nonetheless, these 'pluses' are a vast improvement over CP/M 3.0's 
predecessors and, in combination with the standard 'tools' provided in 
the CP/M environment, offer an opportunity to significantly extend the 
power and usefulness of the C-1 28, 



The Transactor 



51 



January 1986: Volume 8, Issue 04 



Square Roots 

in Machine Language 



' i;-' 



■^^ ' 



Jim Butterfield 
Toronto, Ontario 



1- _"' "li- 1 



Remember those manual square roots?. . . 



} *■ 



J^i 



." J- ^1- ■■ ■ 



■r ^ ^*-^ *l -'tl Ui'^'\ J^" i'-i/'^i;i!_?'* 



I 4 



. "uiTir. ^i". 






VI'' -*J^|L 



_ n ■ 



. ,.1 



/' 



There are quite a few ways of doing square roots, Basic does the 
job via the exponential/logarithm functions. Other methods use 
sucessive approximation: estimate a first value of the root, and 
then improve it. The usual formula on this last is: 

new root = (oldroot + value/old root)/2 

But there is a fast, direct method. It may only be worth the 
coding effort if you have a program which performs a large 
number of square root calculations. You might find it interesting 
to trace through. It's very much like the square roots you used to 
do manually in school. 

Remember those manual square roots? They worked something 
like this: 

— pair off the digits into sets of two; 

— bring down pairs of digits at a time for a trial "root''; 

— take the root so far, times 2, as the "multiplier". . . 

r 

. . .but it's easier to show in an example. Let's take the root of 
34567. We pair off the digits and try for a root of 3: 

3 45 67 (1 
1 1 



\ 



-I 



1 1 - 



1 



28 



36 



I I 



3 45 67 (18 '- ' ■ 
t 

I 

2 45 
2 24 

21 67 



M ■ 4h 



T1I 



iJ IIJ 



Note that the new multiplier is 18 times 2, or 36. 9 times 369 is 
much too big, so we go through 8 times 368, 7 times 367, 6 times 
366 {almost!) and finally settle on 5: ■ V 



I • ' . :/> 



1 



28 



365 



3 


45 


67 


{185 


1 


1 


r 


, 1 


2 


45 






2 


24 








21 


67 






18 


25 


1 



i. , 



^^ 



.^ 



|>H ' '11 



3 42 



". ■ 1 



There's a hefty remainder; we could continue into fractions, but 
let's leave the result as is for the moment: the root of 34567 is 
185 plus a remainder. --,i . . i- i ; 



It must be a one, since 2x2 would be 4, and that's greater than 3. 
{Is this coming back to you now?) Bring down the next two 
digits, and double the root so far to make a '^multiplier'' (1 times 
2 is 2): 



1 



3 45 67 (1 
1 

2 45 



We can do all this in binary, and it becomes much easier. Since 
each digit will be either or 1 , our choice is to subtract (1 ) or not 
to subtract (0). 

Let's go directly to the method. We'll illustrate it graphically. 
Place the value in a work area, and put a "remainder" buffer 
filled with zeros at the high end. Set the root to zero: 

: REMAINDER : VALUE : :ROOT: 
:0000000000000:01111001: rOOOOOO: 



For the next digit, we might try 9 times 29. 8 times 28. , . that 
ones works, it gives 224. which is less than 245, So we subtract 
and repeat: / . 



For the sake of the example, we'll put a value of 121 (binary 
01 lllOOi) into the value. Hopefully, the result will be 1 1 (binary 
1011). 



-^i^ij,i /•_' 



■'III J''T 



■l'< 



-y 



The Trantoetar 



52 



January 1988: Volume 8, Issue 04 



Grab two digits - that means two bits in binary turns. We do a 
"long shift left" on the REMAINDER/VALUE combination. Since 
we re going to the next "result" digit, we41 shift the ROOT one 
place left, too: 

: REMAINDER : VALUE : : ROOT : ; 
:0000000000001;111001..: lOOOOOO: . , , ,. 

For a multiplier, we lake R00T*2 (same as ihe decimal method), 
which is ROOT shifted by one more position. We add 1 to try a 
"multiply by 1": ... 

: REMAINDER : VALUE : : ROOT : : MULT : 
iOOOOOOOOOOOOhlllOOl ..: :000000: :000001: 

Comparing, we find that MULT is NOT greater than remainder. 
So we increment ROOT and subtract MULT from REMAINDER. 
This gives: 

: REMAINDER : VALUE : : ROOT : 
:0000000000000:1 nOOl . , : ;000001: ' 

On to the next pair of bits. As before, a double left shift to 
REMAINDER/VALUE and a single shift to ROOT We 11 calculate 
a new MULT at the same time: 

: REMAINDER : VALUE : : ROOT : : MULT : 
lOOOOOOOOOOOl 1:1001 , . . . : :000010: :00010!: 

See how MULT is ROOT times 2 plus 1? Well. MULT is bigger 
than REMAINDER this time^ so we skip to the next step with 
another shift; 

: REMAINDER : VALUE : : ROOT : : MULT : 
10000000001110:01 : :000100: :001001: 

MULT is pretty big, but REMAINDER is bigger, so we do our 
thing on subtraction: 

I 

: REMAINDER ; VALUE : : ROOT : : MULT : 
lOOOOOOOOOOlOLOl : lOOOlOl: :001001: 

Here comes the last step ... we're shifting the last two bits of 
value. If we went beyond this point, we'd be into fractions. Here 
goes: 

: REMAINDER ; VALUE : ; ROOT ; i MULT : 
iOOOOOOOOlOlOl: : :001010: :010101: 

MULT is equal to REMAINDER, so we subtract and increment 
ROOT. 



^V 



X . 



: REMAINDER : VALUE ; ; ROOT : 
rOOOOOOOOOOOOO: : :00101 1: 



^ h 



We're finished. The ROOT is 101 1 (decimal 1 1) and the remain- 
der is zero (correct!) 



-^ 



idir 



Us important to provide the right amount of space for the various 
numbers such as REMAINDER and MULT It's more than you 
may think at first. 



-ii 



hJ -Hi. 



For example: suppose we're doing the root of an unsigned two- 
byte number (the range is from to 65535) It's plain that an 
integer result will fit into one byte (range to 255) so long as we 
don't need to round it. How big might the remainder be? Well, 
the biggest remainder would be for SQR(65535). If you work that 
out, it's 510, which means that nine bits are needed. But wait! 
That's the remainder AFTER the last subtraction; before that, 
the value in REMAINDER was 1019. . . a ten-bitter. 

In either case, two bytes are needed in this example, for both 
REMAINDER and MULT. That means we must do a two-byte 
comparison, and a two-byte subtraction when needed. Don't 
overlook those extra bits or you'll get wrong answers. 

T . r I 

I I.I 

To demonstrate the method, program ROOTS64 does simple 
square roots. To keep things at their simplest, the program does 
integers only and uses only single-byte areas for REMAINDER 
and MULT. As a result, we'd better keep our values in the range 
of to 4096. That will allow us to keep REMAINDER and MULT 
within a single byte. .,,■. ■'■ ,-, ,, i 



-■ ( 



Once you know the principles, it's easy to expand the method to 
cover bigger numbers, fractions, or whatever fits your objec- 
tives. ■; ., ,.,,.. M 



BC 

BG 

HH 

MG 

LG 

MJ 

NM 

BG 

FN 

MN 

HN 

LD 

Jl 

FN 

CN 

OJ 

GD 

CI 

Fl 

LP 

AB 

PC 

CC 



100 v% = rnd(0):rem .. this must be first 
110data160, 2, 177, 45, 141, 161, 3, 
120 data 0,145, 45,200,177, 45,141, 

1 30 data 3, 1 60, 0, 1 40, 1 60, 3, 1 40, 
140 data 3, 14, 162, 3, 46,161, 3, 
150data160, 3, 14,162, 3, 46,161, 
IGOdata 46.160, 3, 14,163, 3,173, 
170 data 3, 10,170,232,142,164, 3, 
180data160, 3,205,164, 3,144, 9, 
190 data 163, 3,237,164, 3, 141,160, 
200 data 200, 192, 8,208,204,160, 3, 
210 data 163, 3, 145, 45, 96 
220forj = 828to912 . ; . ,, 

230 read x: t = t + x: poke j,x 
240 next j 

250 if t<>8554 then stop ,, .. 

260 rem test run starts here 

270forj = 1 tolO 
280v = int{rnd(1)*4096) 

290 v% = V 

300sys828 

310 print "the root of";v;'is',v% 

320 next] ....... 



.; '!it J 

16'9 

162 

163 

46 

3 

163 

173 

238 

3 

173 



■r.i.'- 



, 1^^! 



■r ,-^ 



■i 'I 



'*']] ^ K>t(\ ii--*u 



The Transactor 



53 



January 1986: Volume 8, Issue 04 



PLACEHOLDER 

for the Commodore 64 



M 



:,r\--, (■■■ 



Paul Blair 
Holder, Australia 



I k' 



[n a very early Transactor, Jim BuUerfield presented a very handy 
routine to cope with a perennial screen handling task. The program 
was designed to allow you to remember the location on screen 
where you last printed, so that you could go someplace else lo print 
something else, then return to where you left off. 

The sort of tasks that spring to mind for this sort of routine would 
include error messages or continue prompts. It is considered good 
design to help an operator by always putting help messages at some 
fixed place on the screen, and the bottom line is a favourite spot. 

So you may print on line 2: 

ENTER DATE [MM/DD/YY]: 

andhaveacheckbuiltinthatMM has to be between 1 and 12. If the 
operator enters '13', it would be nice to remind he or she that any 
value outside the 1-12 range cannot be accepted. A quick print to 
the bottom line 'PLEASE ENTER 1-12" would be courteous and 
helpful. 

I recently had to arrange this sort of thing from within a machine 
code program. So, 1 needed a short routine to do the work for me. 
PLACE, the extract from that program, shows how it was achieved. 

Because the Commodore 64 is so crammed with useful items, it is 
easy to overlook the possibility that it may be easier to use a routine 
set up for us by Commodore than to design our own. Such was the 
case here, because I had overlooked the PLOT routine written by 
Commodore to permit a sort of PRINT® on the screen- 

PLOT seemed useful to locate to the screen, but PLOT has two sides 
to it, a fact 1 rediscovered when I re-read the reference books, 
something we should all do from time to time!! PLOT can not only 
set the cursor anywhere on the screen, but it can also work out 
where the cursor is at any time. By using PLOT to read the screen 
and remember what it sees, it is easy to duck off to the bottom line 
(using PLOT to get there), then recall whence the cursor came and 
go back there for whatever is to happen next. 

The Kernal address for PLOT is $FFFO (or 65520 in decimal). The 
Kernai is the index lo the location of the actual routine, which lives 
at $E50A (58634). My habit is to use the Kernal addresses, because 
they might just stay in the same place in whatever machine comes 
next, whereas I can bet my wife's last dollar that the actual routine 
will have moved. 

I 

Let's look at my machine code first. To READ the screen with PLOT, 
it is necessary only to set the carry flag (SEC is the instruction) and 
call PLOT. The X and Y cursor positions (across and down, if you 
like) will be in the X and Y registers when PLOT finishes its job. 
Store these values in a handy place (move them to a protected 



location) or push them onto the stack, and we now know where we 
have come from. '''' ' 

Now, load X with the "across" value and Y with the "down" value, 
and go back to PLOT Print the message you need, then (in this 
example) wait for a keypress before continuing on. When, the 
keypress comes, recover the old values, load them in the X and Y 
registers, and PLOT again. Now you are back to where you left off. 



The r( 


)utine looks like this: 
100remsave"@0:pace,pa' 


■ ■ 1. 


FB 


!('■ ■ li 


NG 


110 open 8,8,8, "Oip ace.obj.p, 


w 


JE 


1 20 sys 700 




FK 


130 .opt o8 


1 


L 


140;/////////////////////////////// 


OM 


1 50 ;// 


// 


F 


1 60 ;// machine code p aceho der // 


■ C 


1 70 ;// lor commodore 64 


II 


MO 


1 80 ;// 


II 


LM 


190 ;// routine to ho d screen 


II 


JB 


200 ;// p ace, print message on // 


LH 


210 ;// ast ine, then return 




CB 


220 ;// whence thee came 




OB 


230 ;// 




HC 


240 ;// may 85 pau b air 


ft t 


CD 


250 ;// 


// 


AD 


260;/////////////////////////////// 


E 


270; 




LB 


280 ;// c64 basic 2.0 routines // 


J 


290; 




EP 


300 border = $d020 


;exterior colour 


FE 


31 Ocean - $e9ff 


.erase ine in .x 


K 


320 chrout - $ffd2 


prntachar 


PG 


330getin = $ffe4 ; 


;getakey 


JO 


340 pel = $fffO i 


;screen routine 


EN 


350; 




EJ 


360 ;// main program // 


■ 





370; 




KK 


380* = $c000 ; 


;sys49152ca s 


MP 


390; 




OF 


400 ;// error message f ip bord 


er// 


AB 


410; 


■ 


JO 


420ohdear da #$02 ; 


visua error 


C 


430 sta border 




OJ 


440 sec ; 


.get our p ace 


AM 


450 jsr pot ; 


by reading screen 


OL 


460 txa ' ■ ; 


for X, y va ues 


F 


470 pha ; 


Dush them away 


BM 


480 tya ; 


for ater use 


GG 


490 pha 




FK 


500 c c ; 


set new ocation 



' ■ ,r 



: 



The Transactor 



94 



January 1968: Volume 6, Issue 04 



CB 

MN 

Fl 

MM 
GF 
LN 
IG 
BB 
EK 
NE 
EJ 
HI 
OP 
EP 
DP 
PF 
KD 
OP 
IC 
NK 
MD 
HP 
HN 
GH 
HI 
EG 
PN 
MM 
KL 
Kl 
AK 
Al 
EL 
MJ 
LK 
ID 



\ 



Idy 
Idx 

Ida 
jsr 



#$0c ;12over 

#$18 ;24down _ 

plot ; put cursor there 

#>cermsg ;print message 
#<cermsg ;mavbe add a 



pfimms 
getin 
beq keypis 
Idx #$18 
clean 
#$0f - 
border 



510 

520 

530 .- 

540 -^ 

550 

560 ■ ■ 

570 keypis 

580 

590 

600 

610 

620 

630 

640 

650 

660 

670 

680 

690 

700 

710 

720 prJmms 

730 

740 

750 primm2 

760 

770 

780 

790 

800 primm3 

810 

820 

830 

840cermsg .byt$12: .asc" press any key " 

850 .byt$92,$00 

860 .end 



^- 



Ida 
sta 
pla 
tay 
pla 
lax 
cic 
jmp 



plot 



;'tone here too? ' 
iwaita^key ' ' ",, ' 
;loop if no key 
; erase message 
;on bottom line 
;reset border colour 
;to normal 

I r 

;recall where you 
;were before 

;ahd go there 
;(rts) 



1 1 v; 



//print messages// 



sty 
sta 
Idy 
Ida 



$5d 
$5c 
#$00 
($5c),y 



beq primmS 

jsf chrout 

iny 

bne prinim2 

rts 



;point to message 

; counter 
;getchar 
;if zero, end 
;print it 
;inc index 
iloop back 
:all done 



//message// 



A Basic program to load the code, then give a very simple 
demonstration would be handy. 



NE 
CF 
FJ 
FG 
AA 
ND 
EC 
DJ 
AH 
DK 
KB 
PL 
JA 
LD 

GC 

GM 
GB 



100 rem: placeholder example 

110 rem: first load data into ScOOO 

120 rem: then show off 

130 rem: paulblair 5/85 

140: 

1 50 goto 330 

1 60 m = 53280: rt = 491 52: print chr$(31 

170 pokem, 15: pokem + 1, 15 

1 80 prinf[CLR] test placeholder": sys rt 

1 90 print: prinfhello there! ";: gosub 290 

200 print" from transactor magazine'; gosub 290 

210 print: print: prinfasyou can see, ";: gosub 290 

220 print"screen control is easy": gosub 290 

230 print: print; print" now i'm here" 

: gosub 290 ■ ' 

240 print: print: print: print: prinfnow down here" 

: gosub 290 - " ' ";' ,' 

250 print: prinfhavefun!!";: gosub 290 ^, |, , ,,, 
260 print" have fun!!';: gosub 290 :, . i. 



*\.\ 



' 1 1 



OL 

Ml 
JM 
AK 
FF 
EL 
GJ 
BO 
NG 
PJ 
GO 
■GF 
GK 
MJ 
LM 
PC 
MA 
LF 
ML 
GO 
DF 
HF 



270 print" have fun!!': gosub 290: end 

280 : 51 ^ _ 

290 tor delay = 1 lo 1 000: next: sys rt: return 

300 : ^-^ *• * 

310 rem: load m/c into $cOOO 

320 : ■ I - 

33Gs = 49152:f = 49237 

340for i = sto{: read a; cs = cs + a: poke i, a: next 

350 if CS01 0286 Itien prinferror": end 



I ? /\- 



.■•'t 



^'L 



^ t-di f V 



360 clr: goto 160 

370: - ■^^'■'^^'" 

380 data 169, 2,141, 32,208, 56, 32,240 
390 data 255, 138, 72,152, 72, 24,160, 12 
400 data 162, 24, 32,240,255,160,192,169 
410 data 68, 32, 51,192, 32,228,255,240 
420 data 251, 162, 24, 32,255,233,169, 15 
430data141, 32,208,104,168,104,170, 24 
440 data 76,240,255,132, 93,133, 92,160 
450 data 0,177. 92,240, 6, 32,210,255 
460 data 200, 208, 246, 96, 18, 
470 data 69, 83, 83, 32, 65. 
480 data 75, 69, 89, 32,146, 



32, 

78, 





80, 
89, 



82 
32 



T ■ _ 



n^'.\"- ■'/" 



^.1 



"1 i 



All those PRINT statements are there lo show thai old habits die 
hard. Why not move around the screen using the same routine, but 
this time in Basic? ■■ ^ . . ,,. 

How do I do that in Basic? This will involve a bit of PEEKing and 
POKEing, but it's not too difficult. The prime locations are 78! , 782 
and 783 (decimal), which are the 'save" locations for the X and Y 
registers, and the flag register. ,; , ^^..t^'i 

You will recall tfiat we have to set and clear the carry flag to read/ 
write from/to the screen. The carry flag is Bit 1 (decimal value 2} in 
the flag register, so we have to twiddle that bit to arrange our "set" 
and "clear". 

' . I ■ - ' _■ ' 

Id , - _ 

To READ the screen, Lines 160 and 170 return X and Y for you. 

Lines 180 and 190 move the cursor, and print the message in Line 
200- Lines 220 and 230 respond to the keypress. - - ■■ 



GM 
BF 
MO 
KL 
AD 
Al 
OM 
ML 
CH 
DN 
DG 
GL 
PB 
MF 



1 00 rem: plot routine in basic 

110rem: paul blair 5/85 ' , 

120: 

130prin1chr$(147}i:sy = 65520 ■ ■■ - ■ 

140a = 781:b-782:c = 783 ■■■ ' 

150 prinfhello there"; 

1 60 poke c, peek(c) or 1 : sys sy: rem set carry flag 

1 70 X = peek(a): y - peek(b) 

1 80 poke c, peek(c) and 254: rem clear carry flag 

190 poke a,24: poke b, 14: syssy , i, 

200prinfpressakey"; 

210gety$:tfy$="then210 

220 poke a, x: poke b, y: sys sy 

230 prinffrom transactor" 






..^ 



HI 



ii 



There you have it. As the screen tells you, have fun!! 



p - 



^' 



, 'y 



:- i- 



.. * : 



,.'l ■! 



Th«Tranioctor 



55 



January 198B; Volume 8, Issue 04 



Reviews 8W9iv35I 



:ov. '. -V 



The Turbo Processor for the C64 

65C816-based expansion hardware 
with 64K of battery backed-up RAM 



from SwissComp Inc 



Review By S, Brown PuUiam 

© Copyright 1987 S. Brown Pulliam 

The Turbo Processor is one of the more ambitious add-on boards for the 
C-64 that [ have encountered. Physically, it is just an open circuit board, 
without a case, that plugs into the Cartridge Port. It will require careful 
handling and anti-static precautions, h replaces almost the entire C-64 
with the exception of I/O functions (keyboard, SID, VIC graphics chip, 
and disk access). All other functions, that is, the microprocessor chip, 
all RAM, and most of the ROM are replaced by higher performance 
alternatives. The mosf spectacular facet of the upgrade is the micropro- 
cessor chip itself, the W65SC816. This is a 16 bit CMOS upgrade of the 
6502 family with an enhanced instruction set and a 4 MHz clock. The 
second major feature of the board is a heretofore unheard of (for 
Commodore) 64K of battery backed RAM. The ROM chip appears to be 
a 32K device loaded with two 16K operating system replacements for 
the C-64 Basic and Kernal. The on-board RAM is maintained by a 

rechargeable NICAD battery. 

The board carries a list price of $189.95 (US), It is not overpriced for the 
amount of hardware it contains, but we must ask what it will to do to 
improve the operation of our C-64. SWISSCOMP Inc, the Swiss design- 
ers of the board, claim hrst of all that the 4 MHz chip will allow most 
programs to run 4 times faster, hence the TURBO name. They admit, 
however, that there are several functions that will not be speeded up. 
The disk operations, loading and saving, run at the old Commodore 
speeds, as also must anything having to do wiih the VIC chip, since it 
cannot do graphics faster than a I MHz clock rate. In addition, any 
prc^ram that uses the CIA chips must also keep the old 1 MHz speed 
limit. 

The other potential advantage for typical commodore users is the non- 
volatile RAM. With battery backed RAM. if you turn off the computer, 
or have a sudden power dropout, your program is still stored where you 
loadedil. As a designer of some battery backed RAM cartridges, I am in 
a good position to recognize the advantage of having the entire 64K of 
RAM protected by a battery. 

An advantage the TURBO PROCESSOR is supposed to offer to some 
programmers is a large number of additional machine language com- 
mands and increased addressing capability of the 65C8i6. However, 
the additional address lines are not made accessible to external RAM on 
the model I tested, so the 16 megabyte address space is of academic 
interest only. Nevertheless, the added \G bit instructions can certainly 
improve programming efficiency and further speed up many pro- 
grammed operations, and is one reason, I'm sure, that this micropro- 
cessor was chosen for the Apple llGs. Unfortunately, programs written 
with 16 bit instructions will only run on C-64s that are also equipped 
with TURBO PROCESSOR and will not, in general, be compatible with 
the Apple, The utility of the expanded instruction set is further compro- 



mised by the fact thai an assembler that supports these instructions 
may be hard to come by. Perhaps there is one available in Europe 
where TURBO was originally introduced. I realize it would have been 
beyond the scope of the manoal to do a tutorial on the 65C816 
instruction set, but to not even list the instructions, nor mention 
anything about how to get out of the 6502 emulation mode TURBO 
seems to stay in, shows they weren't even trying. 



■'.'■' Jl 



The concept of this expansion card is promising, biit there are a- 
number of major problems in making it truly useful to the average user 
You start off by having to check the positions of 8 dip switches. Then, 
some users will notice that when the computer is turned on, the screen 
message will begin to display a few, or on some C-64s, many random 
characters. The manual instructs you to adjust two small potentiome- 
ters (they take a VERY small screwdriver, and one is hard to get at) 
while continually pressing and releasing the RESET button. On two of 
the six C-64s 1 tried this with, I could not find a combination that would 
get rid of the random characters. Any program that displayed charac- 
ters on the screen would be virtually useless on these C-64s. Three C- 
64s had no random characters, and on one, the adjustment did help. 
The two C-128S I tried to use (in 64 mode) with TURBO would not run 
by the normal method of holding the C= key when powering up. If you 
place one of the DIP switches in theOFFposition. turnon theC-l2Sin 
64 mode, then move the DIP switch back to TURBO ON, TURBO did 
run, but with the same severe random characters that incapacitated 



twoof theC-64s, 



fJi'.^ 



r ir 



Assuming your C-64 has no problem with random screen characters, 

the next hurdle is to find out whether TURBO will let your program run. 
Start by assuming any cartridge will create a problem, even if you have 
an extender card. Some programs have made use of undocumented 
6510 op-codes, and these will definitely not run with TURBO. There 
would be a question about disk copy protected software. 1 tried a recent 
version of Pocket Writer il which is heavily copy protected, and it would 
not load with TURBO. A non-protected program written in Basic, or 
using machine language with a Basic loader should givt no problem, 

I thought I would try out the speed improvement by running my trusty 
Paperclip word processor This program has an 80 column display 
mode that is nice for viewing text for its format accuracy, but is 
annoyingly slow when it is scrolling down the page. How nice a 4 times 
speedup of that scrohing would be, Alas, it was not to be, I plugged in 
the dongle and inserted Paperclip into the 1541 drive. The first gotcha 
was that I couldn't use the Auto-Boot utility in my Brown Box to quick 
load Paperclip with the TURBO PROCESSOR in control at power up, so 
I un-plugged the Brown Box, and let Paperclip do its normal one minute 
load. When I got the READY, typing in RUN just hung up the computer 
1 found this very surprising, since Paperclip is a very tame prc^ram. 



- -y 



t — 



The instruction manual warns that some games that use video sprites 
heavily may have some trouble with TURBO, if so, they suggest 
soldering a three conductor cable from three terminals on TURBO to 
pins 6,7,and 8 of the PLA chip inside the C-64. The addition then 
requires a track tut on TURBO and the soldering of a jumper wire. This 
is not a trivial modification. 

I was impressed when I loaded a monitor prc^ram and could turn the 
computer off, then back on, and could SYS to the preserved utility, no 
matter where in RAM itbegins. One important exception is the Cassette 
bufler which as usual gets zeroed on reset. A Ba.sic program won't run 
when the computer is turned back on because the power-up reset 
iniiiahzes the Basic pointers. This opens the question of what advan- 



The Transactor 



56 



January 1968: V<riume 6, Issue 04 



tages of this 64K of battery backed fWM can actually be utilized. 
TURBO will save a program, but, if you want to run it again, you need 
some software to restore the start up pointers. Even more software 
would be necessary if you wished to pick up the program with 
previously generated strings and variables intact. Different software 
would be required if you wished to store several programs at once. It is 
possible that the alternative operating system included in its ROM may 
have some re-initializing software, but if so, they don't mention it in the 
documentation. 



F ■ 1 



I- 



■ ' ^ 



As you may gather, a non-technical user may find TURBO heavy going. 
Unfortunately, the instruction manual is poorly written, or I should say, 
translated. The original, in German I would guess, might have read 
somewhat better. This version is very skimpy, considering the com- 
plexity of the product. The technical person is somewhat put off, at least 
1 am, by the obvious pains SWISSCOMP have taken to obliterate the 
numbers of many of the logic chips on the board. To be useful, a 
product like TURBO must be documented in such a way that qualified 
people can learn enough about it to interconnect it with a variety of 
hardware and software. The SWISSCOMP people are obviously more 
worried that someone may copy their circuit. 1 can assure them, from 
my experience marketing a product line that also has its greatest appeal 
to the techie user, a good design is only attout 1 0% of the pb. The other 
90% is communication with the potential user. 

TURBO PROCESSOR is a powerful piece of hardware, but 1 would 
guess that it will coexist with only a small fraction of commercial 
programs. It doesn't seem to allow a 1 764 RAM Expansion Unit to run 
if both are mounted on an extender card. If the TURBO connect DIP 
switch is in the OFF position, 1 764 RAM TEST runs successfully, but as 
soon as it is in the ON mode, the RAM test fails. The designers have not 
provided software utilities that enable non-technical users to conven- 
iently take advantage of its power. We are therefore left to wonder who 
will choose to write software to use its capabilities. As a programmer. 1 
have long held the 6502 in special favour, and have hoped that a 16 bit 
upgrade would become generally available. The logical place for that to 
have happened would have been when Commodore designed the C- 
128. Think where a C^128 that had a 65C816 and could directly 
address its RAM Expander as 512K of continuous memory could be 
priced relative to the Apple IIGSI It is sad to contemplate that missed 
opportunity. The most important question is whether a combination of 
add-on modules for the C-64 makes enough sense from an engineering 
standpoint to convince programmers that there is a reasonable expecta- 
tion of a significant market for its software. TURBO PROCESSOR is 
wasteful, h makes absolutely no use of the internal processor or of the 
internal 64K of RAM, I must admit my thinking is coloured by my own 
products, but I submit that added RAM, whether battery backed 
cartridges such as inine, or volatile RAM such as the Commodore RAM 
expanders, should not lake away the utility of the existing C-64 f?AM. 



— h 



Given the choice between more speed and more speed combined with 
lots more storage space, the Commodore 1 764 RAM Expansion Unit is, 
in my opinion, a better engineering solution. The 1764 's potentiality for 
faster programs is twofold. Many existing programs that depend on 
disk file access will run hundreds of times faster once a RAM DOS is 
loaded. The other speed advantage of the 1 764, for new programs, lies 
In lis DMA capability. We have come to think of machine language 
programs as blindingly fast. The 1764 can be used to move a large 
block of bytes fn>m one part of C-64 memory to another eight limes 
faster than machine language! When you consider that a program 
spends much of its time moving bunches of bytes from one part of 
memory to another, you can see the potential for speed improvement. It 
should be at least equal to using the full 65C8I 6 instruction set, and the 
faster clock rate of TURBO. True, the 1764 is volatile RAM and cannot 
remain loaded when power is off, so thai is a trade off against its 256K 
storage capacity advantage. With an extender card, the 1764 can 
coexist with a battery backed RAM cartridge, and some programmers 



might wish a similar capability for TURBO to handle pointer restoration 
without detracting from the 64K of RAM space. TURBO won't allow 
this, and it even seems to force a RAM upper limit of 64K because it is 
incompatible with the 1764 Expansion Cartridge. 

Many creative programmers who used to write for the C-64 have moved 
on to more powerful computers. I am afraid the TURBO PROCESSOR is 
not the gadget that will lure them back to the 64. 

About The Author 

Brown PutUom is Chief Engineer of Brown Boxes, Inc. He designed the 
QUICK BROWN BOX tine of & 16, 32 and 64K battery backed RAM 
cartridges for the C-64 and C- 128. and for many years was an Engineer 
with GENRAD. Inc. He presently consults in the field of electronic 
testing. ' . ^ - - ' - ^^ ■ ' ' '■^'^ '■ 



>' 



n: 



Machine Language Routines 
for ttie Commodore 64/128 

by Todd D. Heimarck 
and Patrick Parrish 

from COMPUTE! Publications 




Review by Mikk>s Ganunszeghy 

Have you ever thought that you have been re-inventing the wheel 
every time you write an assembly language program? Would you like a 
large library of documented assembly language source code routines? 

Or, are you merely curious about how asserrtbly language is actually 
used in practical applications? 

If you answered yes to any or all of the above questions, then you 
should consider acquiring a copy of "Machine Language Routines for 
the Commodore 64/128" from COMPUTE! Books. The 580 pages of 
this recent release contain the assembly language source code for some 
200 fully documented, commented, and tested routines for performing 
a wide range of tasks from file input/output to floating point math to 
programming the CIA TOD clocks to alphabetizing and searching lists 
to ASCII <> PETSCIl conversions, to name but a few. Although they are 
not intended to be used as stand alone programs, many can be used 
with little or no additional programming by incorporating the additional 
coding provided with each n^utine to demonstrate its use. 

Now that [ have tweaked your interest, let me start at the beginning. 
The first few chapters of the book are devoted to a description of the 
6502/6510/8502 type mnemonics instructions such as LDA, STA, etc. 
and their associated op-codes, and the KERNAL function calls such as 
CLRCHN, SETLFS, etc. The mnemonic descriptions are similar in style 
to those found in olher COMPUTE! books on machine language 
programming. The descriptions are short but clear and to the point. 
References are made in the introduction to several other more compre- 
hensive works on machine language and assembly language program- 
ming, including some non-COMPUTE! publications. The descriptions 
of the KERNAL function calls, which include both standard ones as well 
as the new C-1 28 entries, are also short but clear. No real examples of 
how to use either the KERNAL or the op-codes are given at this point, 
but all are used extensively in the remainder of the book. 

The meat of the book is some 500 pages of carefully explained and 
documented assembly language routines arranged in alphabetical 
order by an arbitrarily assigned program name such as ALARM2 (for 



TheTratuoctor 



57 



January 1966: Vblume 8, Issue 04 



setting up TOD clock*2 as an alarm dock) or BORCOL (for changing 
the border color). The routines are presented in a formal suitable for a 
PAL or BUDDY lype assenibler, but the introduction gives tips and 
guidance for converting the listings to otlier assembler formats. If you 
prefer to do it the hard way, tfie routines can also be entered using a 
monitor such as BASIC 7.0's MONITOR command- However, this 
approach does require much more manual labour on your part for 
calculating absolute addresses and label references. Tedious, but possi- 
ble. 

The routines are presented in true assembly language formal with 
address and data labels. (Despite the reference to machine language in 
the title, the book actually deals with assembly language. There is a 
small but definile difference between the two. Strictly speaking, ma- 
chine language deals with numbers only while assembly language 
deals with a set of arbitrarily defined mnemonics used to represent the 
numbers. For example, SAD $FF S8D SCK) $D0 in machine language is 
equivalent to LDA *$FF : STA SDOOO in assembly language). Unlike an 
earlier COMPUTE! t>ook with a similar title ("Machine Language Rou- 
tines for the Commodore 64"), BASIC loader DATA statements are nol 
provided for the routines. If you want to SYS to any of them from BASIC, 
you must create the DATA statements and POKE it in. An assembly 
language subroutine for creating DATA statements from object code in 
memory is provided as one of the routines in the book. 

Most of the routines are shown as being located in high memory. This 
follows from the C-64 tradition of putting such things in the unused 
chunk of RAM at SCOOO, However, with an assembler, the code is fully 
relocatable by changing the assembly origin statement. If you want to 
incorporate more than one of the subroutines or mix them with your 
own assembly code, relocation is inevitable. It should also be noted that 
on the C-128 the routines should be placed in low memory, say at 
SOBOO or $1300, to avoid having to deal with bank switching for 
accessing the KERNAL and BASIC ROM's as well as the I/O block. 
Remember that on the C-128, the RAM below $4000 is visible in both 
BANK and BANK 15 and is an ideal spot for code needing both 
banks. The introduction discusses these requirements for the C-1 28 but 
makes no attempt to explain C-128 bank switching in assembly 
language {it is very simple) and refers the reader to other sources for an 
explanation. 

Because of the similarity between the two machines, most of the 
routines will work without modification on either the C-128 or C-64- 
Where differences exist, due mainly to different addresses for BASIC 
ROM routines called as subroutines, the documentation for that routine 
clearly explains the required changes for each machine. Most of the 
listings are given for the C-64 format with C-128 modifications listed as 
comments. It should even be possible to adapt the routines to work on 
otherCommodure machines, such as the VIC 20, PLUS/4, etc. Routines 
designed specifically for one machine or the other, such as accessing 
the 80 column chip or RAM expander on the C-128, are clearly noted 
as being such, although 1 suspect that they would work quite well on a 
C-l 28 in C-64 mode with very minor modifications. The RAM expander 
routines should also work on the C'64 with the 1764 expander. 

The collection of routines provided in the book gives something for 
everyone: from some quite simple routines to very complex ones. A 
wide range of topics is provided from math and conversion routines to 
graphics and sound to chip register prc^ramming and many more. In 
fact it covers enough ground to do almost all of the mundane and boring 
tasks that many programmers don't like to waste a whole lot of time 
developing for themselves. Face it, most people are lazy, so why re- 
invent the wheel? If you are really lazy, you can mail in the coupon 
provided at the end of the book with an extra $12,95 (plus postage, 
handling and applicable taxes) and get a disk containing the source 
code for each of the routines in the l}ook in PAL/BUDDY format. Even 
if you choose not lo use the rouh[ies exactly as listed, ihey can serve as 



a very useful starting point for your own custom routines. A list of some 
of the routines included is given in Table 1 . 

Although Ihe inlroduclion slates that the book is nol intended to be an 
introduction lo assembly language programming, I would recommend 
this book most strongly for beginner to intermediate prt^rammers. 
These are the people who would benefit most from the clean program- 
ming style and clear documentation of how each routine works. Despite 
the above statement, the bottom line is that 'Machine Language 
Routines' will be a welcome addition lo the library of virtually any 
assembly language programmer. (Remember. Christmas is not too far 
away), ■:■,.: ;. '„;■ ,i ^.-..^^.-i i 



uiii 



1 1 



I I 






11' 



M TABLE 1: . . I 
Selected Assembly Language Routines 



iT^r ■■ 



Name 

ALARM2 
ALSWAP 

ANIMAT 
BIGMAP 

CASSCR 

CHARX4,CHARX8 

CONCAT 

CUST80 

EXPLOD 

FETCH/STASH 

FiREBT 

INTCLK 

INTMUS 

MIXLOW 

RAS128 

RE80C0/WR80C0 

SPRINT 

WINDOW 

WRBUFF 



Description 



\* 



Y i 



Set up CIA TOD alarm dock 

Alphabetize list by swapping strings 

Animation by character sets 

Display a virtual window portion of larger logica 

screen 

Convert PETSCII to screen codes 

Print magnified characters 

Join two disk files 

Create custom characters for 80 column screen 

Produce an explosion sound i ■ - 

Retrieve from or store in RAM expander 

Read joystick fire buttons 

Interrupt driven on screen clock -, , . 

Interrupt driven background music 

Convert mixed case characters to ail lower case 

Set up a raster interrupt on the C-128 40 col screen 

Read or write 80 column chip registers 

Interrupt driven sprites 

Set C-l 28 window boundaries 

Open a direct disk buffer a write a disk sector < > 



Also: Many math routines such as addition, subtraction, division of 
floating point and integer numbers, conversion from ASCII to integer to 
floatingpoint, etc. 



Merlina28 

6502 Macro Assembler 
Development System 

Written by Glen Bredon 

Produced by Roger Wagner 
Publishing Inc. 




Review by M. Garamazeghy 

There are a number of good assemblers currently available for the C- 
128, among them Merlin-128, This entry, written by Glen Bredon and 
produced by Roger Wagner Publishing Inc. bills itself as a complete 
macro assembler editor system. Merlin is not copy protected and the 
publishers even recommend that you make yourself a few backup 
copiesto work with- ■ ■ t . ' , ■ , -r , 



The Transactor 



58 



January 1906; Volume 8, Issue 04 



When you boot the Merlin disk, you are presented with the main menu 
from which you can load or save source or object files, access disk 
utilities, access BASIC'S MONITOR, exit to BASIC, etc. The options are 
ail fairly straight forward. Most of the work (except loading and saving 
files) will be done in the EDITOR/ASSEMBLER mode. The MONITOR 
can be used to view or test actual assembled object code. 



- ^ 



Merlin features an editor with a wide range of screen and line oriented 
commands for listing, inserting, deleting, moving lines, etc. The com- 
mands are entered with combinations of an alpha key with either the 
control key (for line oriented commands) or the Commodore logo (C = ) 
key (listing oriented commands). Although the commands are fairly 
logical, they may lake some relearnlng if you are used to another editor, 
such as Buddy. The Merlin editor assigns line numbers automatically 
for you in increments of I . To insert new statements between existing 
ones, you must manually enter inserl mode. Of course, all subsequent 
line numbers are renumbered automatically. While this feature is 
handy in some cases, it makes keeping the absolute location of a given 
source code statement difficult if you move lines around a lot. It also 
makes it imperative (as stated in the manual) that you delete lines in 
reverse order. If you delete them in forward order, you will end up 
deleting the wrong lines due to automatic renumbering after each 
deletion. 

Keyboard macros are supported using the ALT key and function keys. 
ALT key combinations are used to enter opcodes (e.g. ALT-a will give 
you LDA, ALT-j gives JSR, etc) while the function keys wili issue editor 

commands. 

The assembler offers a rich vocabulary of pseudo ops and directives. It 
supports nested macros (up to 15 deep) as well as conditional assem- 
blies, assembly directly from a disk file, multiple source file liniiing, 
generation of absolute and relocatable object code and a whole host of 
other features which most machine language programmers find useful. 
Although Merlin works primarily with PRG files, SEQ files containing 
source code can also be accessed from within an assembly by the use of 
an appn^priate PUT pseudo op. Use of SEQ type files allows you to 
create source code on your favorite word processor, which I find to be a 
very convenient feature- 
Macro libraries are supported with the USE pseudo op. With linked files, 
labels can be either global or local, with each local label capable of 
having a different value in different modules. Labels and other values 
can even be assigned values from the keyboard during assembly. 

Text can be handled in the source code in a bewildering variety of 
ways: as PETSCIl text, ASCII text, reverse video, strings with leading 
length bytes, strings with last character high bit set, etc. The only text 
format not supported is Commodore screen code. This complicates 
high speed output to the video chips via direct memory access to video 
RAM rather than printing to the screen. Numbers can be handled in 
decimal, hex or binary. Decimal numbers are default. A special pseudo 
op, FLO, will produce a five byte floating point representation of a 
number. 

The \ 40 and some page manual, for the most part, is well written and 
easy to understand. However, considerable confusion is introduced at 
some points where the text has not been adequately updated from 
previous versions (see for example the printer command described 
below). Numerous typographical errors can also be found throughout 
the text. The manual assumes a certaiEi level of understanding of 
assembly language concepts and offers no guidance on assembly 
language opcodes other than a brief description of how Merlin handles 
certain addressing modes. The reader is referred elsewhere for a 
tutorial on assembly language. As a plus, a pull out quick reference card 
is provided. (It would have been nicer to provide it in the form of a 
keyboard template rather than an alphabetical listing). 



The Merlin disk contains a number of example programs, an object file 
linker and an "unassembler" or source code from object code generator 
(cutely named "'SOURCEROR^' in keeping with its mystical image). 
Each of these utilities is described briefly in the manual. 

Although it has some interesting features, Merlin-128 appears to be 
essentially the C-128 version of an assembler which has been floating 
around the Apple ][ world for some time. While this does not mean to 
say that it isn't any good, it could probably have been made better if it 
were designed specifically for the C-128 from the ground up. A case in 
point is certain portions of the instruction manual which were clearly 
taken from an Apple manual without change for the C-128, even 
though the context is totally different- For example, the printer com- 
mand PRTR is given with the syntax: PRTR <slot number>, etc. The 
slot number refers to the expansion slot in the Apple chassis where the 
printer interface is located. In the C-12S version, the <slot number> 
actually refers to the printer device number The example in the 
manual uses a <slot number> of 2 (1 in the description of the example, 
which adds to the confusion) instead of a usual C-128 type device 
numberof 4or 5. . . , 

Because of its Apple heritage, the format of the required assembler 
source code is perhaps different than what most Commodore users 
would expect. The format is similar to CP/M and MS-DOS type 
assemblers with its predefined LABEL, OPCODE, OPERAND. COM- 
MENT fields rather than the free form structure used by PAL, BUDDY 
and similar assemblers. You are also restricted to one assembly lan- 
guage statement per line. While this makes things uniform, it can lead 
to overlong listings of simple or standard assembly routines. The source 
code is definitely not PAL compatible, although it would not take much 
effort to translate PAL source code. Global search and replace features 
should make replacing pseudo ops quite easy. 

One feature Merlin lacks is a Z-80 cross assembler. L^t's face it, the Z-SO 
on the C-i 28 is one of its most useful features, yet very few assemblers 
will support it (Z-BUD from the BUDDY system does an excellent job). 
A Z-80 cross assembler would allow you to conveniently take advan- 
tage of the 1 6 bit indexing and math modes of the Z-80, something that 
the 6502 type chip sorely lacks. 

In short, if you are looking for a reasonably good C-1 28 assembler and/ 
or you have used Merlin on another machine, then this program is for 
you. If you already have a good C-128 assembler, then I can see no 
reason why you should switch. Merlin is also available for the C-64 and 
several other 6502 type machines. 

Fbr more information, coniact Roger Wogfier Publishing Inc., 1050 
Pioneer Way, Suite P, El Cojon. CA 92020 ■ 



Benchmark Modiila-2 

Modula-2 development system 
for the Amiga 

from Avant-Garde Software 



Product 
Manufacturer 



Review by Nkk Sullivan 

Benchmark Modula-2 Construction Set 
Avant-Garde Software 
2213Woodburn 
Piano, Texas 75075 
(2i4)-964-0260 



T!w Itansactor 



59 



JanuatY 1988: Volume 8, Issue 04 



Retail Price : Benchmark Moclula-2 $199.95 

Simple Libs ' ' $ 99,95 

CLibs ■ ' ' •:" ' $ 99.95 

Image Resource + IFF Libs $ 99.95 



Update /upgrade policy; Upgrades will be available to registered users 
of Benctimark Modiila-2 for $20-$60 depending on nature of enhance- 
ments and amount of new documental ion. Bug fixes are not considered 
upgrades and will be made available at cost of distribution, 

1 I , T , I I ■ 

I, I 

The C language is fean, fast and flexible. It gives you the best of both 
worlds - speed and size that are as close as you can come to pure 
assembler, plus the data handling and powerful commands of a high 
level language. Modula-2 is cumbersome by comparison. The code it 
generates is much less efficient than that produced by a C compiler 
Moreover, its strong data typing and Papa- Wirth-knows-best philoso- 
phy are ridiculously confining. . . no wonder it is often described as a 
voluntary stroitjacket for neurotic programmers. 

♦ • • ^ t 

C is perhaps the weakest excuse for a high level language ever 
developed. The freedom "it gives you to mix data types is an invitation 
to disaster, and at best gives you programs that are almost impossible 
to debug, fts syntax seems to have been specifically designed to 
produce indecipherable source code. Modula-2 does not have these 
problems. With M2, most errors are caught at compile time, so you 
escape the run-time disasters that C programmers all too commonly 
encounter The source code is much easier to read, thus much easier to 
maintain. And the claim that C programs are more ^'efficient" is just not 
true - there's no reason at all why a Modula'2 program has to be 
longer or slower than its C equivalent. If it's maximum speedyou want, 
turn to assembler, not to C. . . unless you like making life hard for 

yourself , 

***** 

To date, the contest between C and Modula-2 as the high-level 
language of choice tor Amiga development has been heavily lopsided in 
favour of C. For one thing, the examples in Amiga programming 
manuals like the Rom Kernel Manuals are almost exclusively in C. 
much to the frustration of those who prefer assembler or a different 
high level language, Fbr another, two excellent C compilers have been 
available ever since the Amiga came out, whereas for Modula-2 pro- 
grammers there was only an indifferent offering from TDl. (Note: TDi 
has recently announced the latest upgrade for their Modula-2 compiler. 
which is claimed to fix the numerous bugs that have been reported in 
previous versions.) 

With the recent release of Benchmark, a new Modula-2 compiler for the 
Amiga, the choice of a high level development language is no longer so 
clear-cut. If the reaction on CompuServe's AmigaForum is any indica- 
tion, the Benchmark Modula-2 is going to interest a lot of people who 
want to do serious Amiga programming. 

Our review copy of Benchmark arrived at Transactor several weeks 
ago, whkh put us immediately in an awkward situation, since none of 
us knew anything much about the language. That hard fact is the 
principal background for this article, in which I want to describe the 
package for you, and tell you about my first foray into M2 program- 
ming, which was an M2 translation of the ^TWM" C prc^ram appearing 
elsewhere in this issue. 

I I I 

The package first. Our copy came with six heavily loaded disks, and a 2 
volume manual totalling more than 700 pages - in other words, an 
impressive quantity of material. Apart from an extensive set of PD 



example programs on the disks, mostly adapted from code written for 
the TDl compiler, all this is the work of one man, Leon Frenkel. 

The basic software components of Benchmark {which Frenkel calls a 
"Modula-2 construction set") are the compiler, linker and editor. These 
are all invocable separately from the CLI but generally will not be. as 
both the compiler and linker are also available from function keys 
within the editor itself. More conveniently still, the editor knows how to 
read the compiler's error output, which is in a binary formal otherwise 
readable only with the aid of a supplied utility, and lets you step through 
the offending lines of your source file (again with a function key) to 
make corrections. m ■ . ■ i ' ■ r ■• 

-.1 . -. ,1 ■ ' 1 4'. ' ' 

The compiler and linker are fast - even faster than their equivalents in 
the Manx Aztec C compiler, as far as 1 can tell - so all in all you have a 
very quick and friendly environment for developing programs. Execut- 
able programs created with Benchmark also run fast ^ just as fast as the 
Manx C equivalent, according to Frenkel^ though I haven't ben- 
chmarked Benchmark and so can't verify that from personal observa- 
tion. The size of the executable will generally be a bit fatter than Manx 
would generate, primarily owing (again, according to Frenkel) to the 
way the Benchmark linker handles libraries - it includes the whole of 
each referenced library in its output, not just the particular routines 
used in the program. This has the most noticeable effect on smaller 
programs (TWM, which is less than 4K under Manx, is about 9K under 
Benchmark), and may help to account for Benchmark's very fast link 
times. 

The only real disappointment in the Benchmark package, for me, is the 
editor, which is yet another variant of MicroEmacs - a slick, enhanced 
Emacs, compared to others I've seen on the Amiga, but Emacs 
nonetheless. Personally, I find Emacs very close to unusable for heavy 
editing- However, I found that entering a program in another editor 
(Rick Stiles' Uedit. in my case), then switching to the supplied editor for 
compiling, linking and fixing errors was quite satisfactory. It must be 
admitted, too, that one's choice of text editors is very much a matter of 
personal taste, so some programmers will undoubtedly be delighted 
with the inclusion of Emacs in the Benchmark package. 

The imposing manual, in our Benchmark, is a special pre-release 
version, and as such suffers from the haste with which it was obviously 
prepared - on some pages the typos almost outweigh the text. A great 
deal of it is given over to documenting the very extensive set of library 
functions Benchmark provides, and even more is devoted to listings of 
the ".def" files, which are Modula-2's equivalent of the include files 
used in C and assembler. Other sections of the manual provide full 
documentation on the editor {a k>l of commands, in the true Emacs 
tradition), the compiler and linker (here you get the usual command 
line options for specifying input and output directories, search paths for 
library and symbol files, a switch for including symbol information in 
the executable file for use with a symbolic debugger like Wack, and so 
on), and the other supplied utilities. Although the package does not 
include its own debugger, a full source-level debugger is planned for 
future release. 

One very useful section of the manua! provides a set of statement-by- 
statement guidelines for converting C source to Modula-2, which is a 
boon for anyone coming to M2, as 1 did, from a C background, and also 
for M2 programmers new to the Amiga who are trying to make sense of 
the heavily C-oriented system manuals. Another section provides 
detailed instructions for installing Benchmark on a variety of Amiga 
system configurations, from a one-drive, 512K system on up to a fully 
loaded Amiga with multiple floppies, hard drive and expansion RAM. It 
is worth pointing out that, even with the minimum configuration, it is 
possible to have the editor, compiler and hnker resident in RAM during 
program development, which speeds things up greatly You may have 
to play with the sizes of the various internal buffers used by the 



The Transactor 



60 



January 198B: Vdlume 8, Issue 04 



. —r^^.vr^T'^mi ■■ ■■■■■ — 

compiler in order to achieve this, but the necessary steps are fully 
covered in Ihe manual, and i! doesn't sound difficult to do. 

My overall impression of the Benchmark so far has been almost 
uniformly favourable, Frenkel has clearly put a great deal of thought 
and effort into making the system simple to use for novice programmers 
without sacrificing power or efficiency. For example, one of Ihe disks 
thai come with Benchmark is a boot disk, configured for a minimum 
system, that puts you right into the editor. The source for a "Hello 
World" program is loaded in automatically; you can compile and link it 
by following the instructions in the comments at the front of the 
program, and thus get a feeling for using the package within minutes oi 
opening at up, without once looking at the manual. I have never seen a 
language package for the Amiga that was easier to get started with, 
AmigaBasic included. 

Another indication of the work that has gone into Benchmark is the 
libraries which, as mentioned above, provide a very rich set of functions 
beyond the standard Modula-2 set. Some of the libraries are not part of 
the basic package but may be obtained either by buying the complete 
system (currently t299 US), or by separate purchase. One of these 
additional sets of library modules seems to have been specifically 
designed to seduce diehard C programmers - it contains complete 
implementations of the standard C libraries for file and terminal input/ 
output, memory allocation, string handling, character conversion and 
more. Other additional libraries provide functions for simplifying the 
programmer interface to Intuition, and for handling IFF and other 
graphics chores in a straightforward way. 

As for Modula-2 itself, I admit to mixed feelings. Like its predecessor, 
Pascal, M2 is the work of Niklaus Wirth, and its flavour derives from 
Wirth's preoccupation with academic correctness in programming 
technique. Though M2 is certainly powerful and open-ended enough 
that you can ''beat the system'^ if you really want to, it does not lend 
itself to underhanded programming tricks with the same casual ease as 
C. This can seem conhning at first, if youVe accustomed to C's free and 
easy ways, particularly since the two languages are syntactically quite 
similar. 

On the other hand, there are manifest advantages to the comparatively 
rigid Modula-2 way of doing things. The strict M2 requirement that 
operands and function parameters be of the correct types eliminates 
many of the hard to trace bugs that type mismatches introduce into C 
programs. Even though I find it annoyingly fussy that I can't mix an 
INTEGER (signed int) with a CARDINAL (unsigned int) in an expression 
without doing an explicit conversion, I have to grant that it's very nice to 
pick up potentially disastrous type mismatch problems at compile time- 
There are a few Modula-2 features I wish C had counterparts for. One is 
the SET type, which allows you to treat a collection of objects as an 
unordered set instead of an ordered array, with appropriate operations 
for the union and intersection of sets, and for determining whether a 
particular number is an element of a given seL Another handy feature 
is the WITH statement, which reduces the overhead for initializing 
structures (RECORDS, in M2-speak). This not only allows the compiler 
to generate belter object code, but also makes for a cleaner- looking, 
easier to read source program. 

Not surprisingly, there are also features of C that are conspicuously 
absent from Modula-2. For me, the most aggravating (and inexplicable) 
is the lack of any way of initializing static data in M2. Where in C you 
might say something like: 

intDayslnMonth[] = {31,28,31,. . .}; 

which costs you just 24 bytes of object code, since the table is 
assembled directly into your program, Moduia-2 requires you to declare 



the array separately and initialize it with assignment statements, a 
comparatively wasteful process. The Benchmark version of the lan- 
guage goes a long way towards dealing with this problem, when dealing 
with graphics data, by providing a facility for concatenating the data 
with your prc^ram, then accessing it by special purpose functions, but 1 
wish there were a more general solution. 

Well, just as editors are matter of taste, so too are languages, and while 
I'm sdll dithering over whether Modula'2 is for me, there are undoubt- 
edly many of who have already made up your minds in its favour. If you 
are one of that many, take a serious look at Benchmark - it's right up 
there among the best development systems the Amiga has to offer. 



TWM in Modiila-2 



1-- 



The following listing is a Moduia-2 equivalent of the twmClient module 
given in C elsewhere in this issue. Many of the comments have been 
omitted to conserve space, but in a few places I have added new 
comments pointing out differences and similarities between the two 
languages as reflected in the program. The full Modula-2 source for 
TWM will appear on the second Transactor Amiga disk, along with the 
C source, execulabies. and several programs to which TWM support 
has been added. 



if li-'ji 



(■ 



This 'detinilion module" specifies which identifiers in twmClient may be 
accessed by other modules. Except tor the main module thatevefy program 
must have, all modules are either "impJementation modules" or a 
corresponding 'definition module" like this one. 

DEFINITION MODULE twmClient: 

PROCEDURE PostMe(ClientName. ARRAY OF CHAR) . BOOLEAN; 

PROCEDURE UnPostMeO; ^ - 

PROCEDURE twmlnitl). BOOLEAN; 

PROCEDURE twrnOeanUpO: 

END twm Client 

IMPLEMENTATION MODULE twmClient, 






This module should be compiled and linked wiih applications that wish to 
be clients ot TWM when it is present in the system. Briefiy, The client 
calls the lunciion twmlnit to set up, aften^ards calls PoslWe whenever 
he wishes to go to sleep, then finally calls twmCleanUp just before 
exiting. Details are in the prefatory comments to TWM mod (and TWM.c). 

The FROM statements below correspond roughly to C include statements, 
except that instead ot inc^udlng an entire die, only ttiose identifiers 
That are specifically wanted are brought in (their names appear after 
IMPORT). It IS also possible to include ALL the identifiers from a given 
file by saying "IMPORT Memory", for example, but in that case every 
reference to an identifier from that file must be preceded by The name 
of the file plus a period (e.g. "Memory AllocMem'). 

■? 

FROM SYSTEM IMPORT ADR, BYTE, ADDRESS, TSlZE; 

FROM Memory IMPORT AllocMem, FreeMem, MemReqSet, MemClear, 

FROM PortsUtil IMPORT CreatePort, DeleiePort; 

FROM Ports IMPORT 
WaitPort, GetMsg, PutMsg, FindPort, Message, MessagePrr, MsgPortRr; 

FROM Strings IMPORT STringLength; 

FROM Nodes IMPORT NT Message; 

CONST (- These are consTant declarations, similar to C #defines 



NULL 

PortName 
GadgNameSize 

twm Action Add 
twmActionOelete 



= N1L; 

- "Ti nyW in dow Manager"; 
= 17; 

-0; 
= 1: 



The Tronmctor 



61 



January 1988: VoJume 8, Issue 04 



(t The underscores in ihe toJlow<ng are not allowed in standard M2, but 
are an exiensbn recognized by Ihe Benchmark compiler ■) 



E_OK 


r: 


E_OPENJNTUI 


==501 


^LREADY_UP 


-502 


E_0PEN_PORT 


= 503 


E_OPEN W NDOW 


= 504 


E_ACT ON_UNKNOWN 


= 505 


E^TASHLUNKNOWN 


= 506 


E_NO MEM 


= 507 


E_ABANDON_SHIP 


-508 



TYPE 
twmWessageRr = POINTER TO twm Message; 



(■ 



The RECORD (i.e. structure) declaration \n the following 
js similar except m syntax details lo the C equivaient 



■) 



twm Message 
im Message 
tmName 
tmAction 



= RECORD 
Message; 

. POINTER TO ARRAY [O.GadgNameSlze-T 1 OP CHAR; 
. INTEGER; END; 



l' ' : 



1 1^ 



RETURN result; „ ■ 
END PoslMe; 

PROCEDURE UnPostMe; 

VAR 

porlGobWer : ADDRESS; 
BEGIN 



twm perl = FindPorT(AOR(PortName)); 



h ^ 



.^*^T0 ij 



\y 



_ .K^i-i 



* ; i V n I 



P ^ 



..I 



il •! 



4^ ^ h 



:(; 



IF twmReady AND {twmport* NULL) THEN 
Del msg" .tmAction : = twm Action Delete; 

Pu tM S9(t wm po r t" , Deim sg) , . 



■■'■ :■'?':■ 


'■■'. ;M 


■'■'■J -fl: 


■-|ri.^:"^iir: 


* 


'*,*' 


a 


1 ''{\" 


1 . -J| 


lis't- 


1 


ll J 


- h ^ ■ 1 




~r'' ' 


} H 1 


' ' ^ -"! . 


-iy*Ln . 



(■ 



4 , 



\ TWM will reply the original (ADD) message before replying this 
one if it's going to reply it at all. . hence the loop exit condition 

REPEAT 

portGobbler . = WaitPort{mp*); 
UNTIL Get Msg(mp^) - Delmsg; 
END, 
END UnPostMe; 



-I I 



VAR (■ global variable declarations •) 
mp ; MsgPortPlr; {• reply port for our msgs 

twmporl . MsgPortPlr; {* points lo twm's port 

Adclmsg twmMessageRr, (• twmActionAdd message 
Defmsg twm Message Ptr; (■ fwmAct ion Delete message 
twmReady BOOLEAN; (• TRUE when ports are allocated and initialized 



This IS a function procedure" - it returns a value. The type of the 
returned value is declared after the colon at the end of the first line; 
in this case, it is of type BOOLEAN. 
■) 

PROCEDURE PosIMe(clientName. ARRAY OF CHAR) . BOOLEAN; 

VAR (- declaration of variables local To this procedure -) 
result . BOOLEAN; 



PROCEDURE twmlnit . BOOLEAN, 



BEGIN 



The variable portGobbler is needed because you are not allowed to ignore 
the value of a function procedure m M2. . you have to do SOMETHING with 
it. Here, and further on. it is assigned lo a meaningless variable. 
•) 

portGobbler ADDRESS, 

BEGIN 
result := FALSE, 

(' 
The caret character '*' is used in M2 to dereference pointers Thus 

Addmsg* tmName is equivalent to C's Addmsg->tmName or, more precisely, 

(•Addmsg). tmName. Notice thai PutMsg and other functions want to be 

RECORDS as arguments, not RECORD pointers. The octothorpe character '*" 

IS one of two ways of saying 'not- equal -to' in M2 (the other is '<>'). 

') 

IF StrrngLength(clientName) # THEN 

IF twmReady THEN 

lwmport:= FindPorl(ADR(PortName)); 

IF twmport# NULL THEN 
AddmsgMmName = ADR{dientName); 
Addmsg^, tmAction ;= twmActionAdd; 

PutMsg(twmporl*, Addmsg); 

portGobbler:- WaitPort(mp'); 



Addmsg : = GetMsg(mp*); 



IF Addmsg*. tmAction 

result := TRUE; 
END; 
END; 
END; 
END; 



E_OK THEN 



(* 



Because you can't test for the success of a function like AllocMem() 
in the same statement as you invoke it, a procedure like twninit is 

significantly bulkier in M2 than in C. 

•) 

IF NOT twmReady THEN 
mp : = CreatePort(NULL. 0); 

IF mp# NULL THEN 
Delmsg : = AllocM em (TSIZE (twm Message). Mem ReqSeTj Mem Clear}); 

IFDelmsg#NULLTHEN 
Addmsg := AllocMem^SI2E(twmMeEsage), MemReqSei{MemClear})i 

IFAddmsg#NULLTHEN 
OeJmsg^.tmMessage.mnReplyPort . = mp, 
Addmsg''. tmMessage mnReplyPorl ; = mp; 

Delmsg^.tmMessage.mnNode.lnType : = NTMessage; 
Addmsg'^.tmMessage mnNode.lnType : = NTMessage; 

twmReady =■ TRUE; 
END; 
END; 
END; 
END; 

JF NOT twmReady THEN 

twmCleanUp, 
END, 

I 

RETURN twmReady; 

J 

END twm I nit; 

PROCEDURE twrnOeanUp ( J; 

BEGIN 
twmReady . = FALSE; 

(• TSIZE in the fdlowing is similar 10 C's sizeof operator. •) 

IF mp # NULL THEN DeietePortfmp"), END, 

IF Delmsg # NULL THEN FreeMem(Ddmsg, TSIZE (twm Message)), END; 
IF Addmsg # NULL THEN FreeMem (Addmsg, TSIZE(twm Message)), END, 
ENDtwmCleanUp; 

ENDtwmClienL 



The Trantoctor 



62 



January 1988: Vblume 8, Issue 04 



.' ■ -1^ 




I -r 

Amiga Dispatches 

by Tim Grantham, Toronto, Ontario . 



i-p: 



I *i 



•-'i 



It's been almost two years now since I began writing Amlgi Dispatches - 
time \Q slare into the fire over a foaming tankard, draw reflectively on the 
pipe and reappraise the future of the Amiga and this column. 

This column started as a kind of tip sheet. News was scarce in the 
conventional media: the only source of current Amiga information was on 
CompuServe. Most of ;/?a/ seemed suspect: '^A board that you plug into the 
68000 socket to make Ihe Amiga faster than a VAX 11 /780? Sure." 

Lots of software was coming Reat Soon Now. ^Reai Soon' turned out to be 
two years, but it has finally arrived - so much so, in fact, that I am very 
pleased to say that I can't possibly keep up with it anyrrKjre, 

Those who have been faithful readers of this column have probably 
noticed a shift in emphasis away from news coverage and towards 
somewhat more persona! commentary. Well, I'm making that crfficial, 
starting with this edition. Fn^m now on, Amiga Dispatches will have a more 
selective focus than it originally had. It will dispense with breathless 
announcements of nev^' software and hardware and replace them with 
more in-depth commentary on a broader range of topics: product trends, 
prc^ramming, computing standards and applications. 

Tm sure some of you are curling your lips in disgust at this point, "Oh God, 
the last thing we need is a Jerry Pournelle clone," I can only say that I will 
try to keep this column lively, informative and thought-provoking. In that 
endeavour, I'm fortunate to have the subjecl I do. Frankly, I still think the 
Amiga is the moa amazing thing since Gandalf slew the Balrog and 
returned to tell the tale. 

All this is not to say that I won't mention the arrival of a game that pushes 
the hardware to its limits or an expert system that will concoct recipes for 
benign recreational pharmaceuticals. But such products will have to 
exemplify what I feel to be genuine innovation. 

We at Transactor believe that, with the intnxiuction of the 500 and the 
2000, the Ami^ has a rosy future. The 500 has a very good chance to 
replace the C64 in the home market over the next five years. It may also 
become the machine of choice for computer science students; where else 
can you get a 68020/68881 machine for less than $1800 (US)? Not to 
mention the multitasking OS and an array of mature yet inexpensive 
development tools, . ■ --j ^4 ■■ -' '. ' ''•'-' 



I ► . 



, ><.'.:- I 



The 2000 will continue to find favour with engineers and scientists. I do not 
believe, however, that the 2000 will make a serious dent in the busihess 



1 it 



^ 



-t.- 



market - MS-DOS is too deeply entrenched. But it will be the first Amiga to 
be taken seriously as a business machine, even more so when it eventually 
runs Unix, ' ' 

The 1 000 will pn^bly gracefully retire, having spent itself blazing a trail 
for the 500 and the 2000. It will be brought out on festive occasions and 
given a place of honour, like restored Bugattis in Canada Day parades. 

But even these confident prognostications may fall short of the mailc. Vox I 
think the Amiga in its various incarnations will provide the platform for 
genuinely different applkations. Given its hardware support for external 
audio and video signals and the increasing 'digitalization' of televisbn and 
sound equipment, the Amiga will prc^ably become the first personal 
computer to be integrated into the average human being's electronic 
environment. 



-■. - 



Meanwhile, it's certainly no slouch in the here-and-now department. Some 
very exciting work, for example, is being done at the Center for Productivity 
Enhancement at tfie University of Lowell- Rich Miner, who is manager of 
the Center, tells me they are' busy porting NCS (Network Computing 
System) to the Amiga. ■ ^ - 

Those of you who read my last column may remember NCS: it's Apolk) 
Computers' system for distributed applications that permits a program to 
run across a network of computers. NCS is network, operating system and 
hardware independent, and is the first proposal to provide the foundation 
for truly integrated computing across a heten^eneous environment. 

They have many types of machines at the Center: everything from micros 
to mainframes. And they are all networked tcgether, mostly via Ethernet 
and NFS {Network File System). Miner(no relation to %) sees the Amiga as 
a a very practical addition to any networked environment. "Wf^ buy a VT- 
100 terminal >vhen for the same money you can buy an Amiga with an 
Ethernet interface and be online to several different hosts simultaneous?*' 
When it comes to NCS, Miner believes the Amiga will provide an extremely 
cost-effective entry into the NCS environment- 

- ■ ■ . I ■ 

f 

Miner is also partly responsible for yet another networking standard being 
ported to the Amiga: he has given the source code to X-Windows to Dale 
Luck at Commodore-Amiga, 

X-Windows is a graphic interface standard developed at the Massachusetts 
Institute of Technology and is destined to become the ANSI standand user 
interface for networked environments. If you have X-Windows running on 
your machine, it will permit your computer to open a window on any 
screen on the network, be it an MS-DOS screen, a Mac screen or a Sun 
workstation screen. Your computer controls that window, wherever it is, 
exactly as it would one that had opened on its own screen: it can draw in 
that window and receive input from it. 

Like NCS, it has a rival from Sun Micn>systems: NeWS, or Network 
Windowing System, NeWS uses the PostScript page description language 
develc^ed by Adobe Systems (its founders did the preliminary work on 
PostScript at XetDx PARC, where all windowing interfaces got their start). 
With NeWS, each machine on the network has a PostScript interpreter 
running. The drawing informatron for each NeWS window is received over 



The Transactor 



63 



January 1968: Vdlume 8, Issue 04 



the network as a string of PostScript tokens. This means ttiat even a 
FbstScript printer on the networii could have a window opened on it and a 
graphic generated. Of course, sucti a window could only be used for oiitpuf. 

With an ANSJ committee working fulf steam on X-Windows. thou^, it 
looks like it will become the offk:ial standard. Fortunately for Sun, NeWS 
can implemented on tqD of X-Windows. As far as 1 know, NeWS has not 
been ported to the Amiga, though it has been made available on the Mac 
and the Atari ST, '"' ^'■'- 



m -^d 



I x^ 



What do NCS and X-Windows mean for the individual? Imagine this: you 
are an engineer for a giant multinational corporation. Your company has to 
produce a prototype design of a turbine fan for a high-performance jet 
engine and it has to do it in one day. At 9:00 am, a conference call is set up 
via satellite with the company's top miiKls from all over the globe in 
attendance. 

Bui this is not sinply a voice conference - all the compters that each 
engineer has access to are also linked up during this conference. Using X- 
Windows and NCS, the participants can display their design ideas on 
everyone eise's screen; in several different views at once if desired. Various 
processors on the network could t)e used to run tests or simulations or 
analyses on tfie designs. Participants could modify other designs as well as 
their own. Once a final deagn had been settled on, a numerically 
controlled milling machine somewhere on the network, somewhere in the 
world, would carve a hunk of metal into the actual prototype. 

Of course, such a scenarb demands an enornxtusly fast, reliable means of 
trananitting data. Fibre-optk: links can provide such speed now. In fact, 
according to Cesar Cesaratto, Vice President of Transmissbn & Hardware 
Technology for Bell Northern Research, within the decade we will have 
fibre optk:s that can transmit 100 terabits per second. With that kind of 
speed, one half of the world's population could talk to the other half over 
(wo optical fibres. 

Whk:h is ultimately the point - transparent communication between 

people. In the conference scenario described above, the purpose of X- 
Windows, NCS, computers, and networks is to provide the invisible support 
for a free and productive interaction tietween the participants. And there is 
no reason why one d those engineers coukln't have been using an Amiga 
during that conference. 

It's this extraordinary range of applrcation of the Amiga - from arcade 
machines like Daily's Sub Hunter to memt)er in good starxling in 
communities of computers - that continues to fascinate me after two years 
and will, I expect, for many more. Damn, it's a neat machine! 

At SKjGRAFU, which is the Association of Computing Machinery's annual 
conference on computer graphks, the same Center for Productivity En- 
hancenwnt mentwned above demonstrated a graphk:s cc^rocessor board 
for the Ami^ 2000. The AmigB I^irallel Imaging Coprocessor can 
use up to seven NEC uPD7281 Image Pipelined Processor chips for an 
effective processing rate of 35 MIPS. It should be available as you read this 
and will cost S2000 (US)- Full software support, including a library of image 
processing functk>ns, will be provided with the board. Similar boards for 
other PCs and workstations can cost $30,000 (US) or more. , . 



i" 



, l,h! 



The Gemstone Group is now selling 68020/68881 boards for the Amiga 
that plug into the 68000 socket- A fully populated board that includes the 
68020 and the 68881 can be had for $775 (US) from The Gemstone Group, 
620 Indian Spring Lane, Buffalo Grove. II 60089. Phone: (312) 537-7405. . . 
Canadians wishing to obtain Face D, whk:h is a major upgrade to the 



enhanced disk access program from ASDG Ifk., must send in tfieir original 
disk, and $2,50 in US funds, Amerk:an owners must send the original disk 
and a self-addressed, stamped envelope. . . This note from Neil Cumfer in 
reply to my query in the last edition o\AD: "DIga means '^eak!' It is what 
our Spani^-speaking amigos say (instead of 'f^ello') wfien they answer the 
phone." Thanks, Neil. . . In turn. 1 can enlighten Neil Boyle of Calgary, 
Alberta who wrote to enquire what 'TANSTAAFL' meant. TANSTAAFL 
comes from the book The Moon is o Harsh Mistress by Robert Helnlein, 
my personal favourite t^ that dogged solipsist. It stands for There Ain't No 
Such Tiling As A Free Lunch, and apparently originates in the days of Mr. 
Heinlein's youth in Missouri when bars would offer free lunch to patrons 
willing to pay an exorbitant price for the beer. . . ^, 

I dropped in on one of the Sunday night conferences on PeopleUnk several 
weeks ago and wfw ^uld arrive but Rob Peck and RJ Mkal! Mkal 
announced that his company, Grab! Inc., had bought the ri^ts to the A- 
Squared LJve! digitizer. Live! had been lost in limbo for some time, as CBM 
ran hot and cold on it through varwus corporate convulsions - a case of 
suspended animation if there ever was one. The devk:e should be avail^le 
as you read this, for $295 (US). 

Speaking of RJ, he and David Needle, another Amiga ori^nal, have been 
hired t)y David Morse at Epyx. who also hired them when he was CEO erf 
Amiga, They are charged with devetoping a new line of "non-software' 
products for Epyx. ' - 

r _ 

Partners, Inc. here in Toronto have used Vldeoscape 3D to create 
computer graphics for a CampbelVs Soup commercial they have produced 
for the American market. Look out for it during the World Series. John 
R)ust of Amazing Computing tells me they are also using Sculpt 3D and 
his own Interchanger to convert object and camera motion files between 
Sculpt and Videoscape. John is hard at work writing a number of gr^hics 

suf^rt packages that include a texture-mapping prc^ram that lets you 

project any IFF image onto the surface of a graphic object. You can buy 
Interchanger for $49,95 (US) from him at Syndesis, 20 We^ Street. 
Wilmington, Massachusetts, USA 01887. John is disassociating himself 
horn Amazing Computing, partly to avoid conflk:ts of interest and partly 
because d dissatisfaction with the way the magazine is being operated. He 
will continue to act as a technical consultant. . , Sculpt and Video,scape have 
been joir^ by animatbn packages Forms in Flight by Micro Magic and 
Silver by Impulse, and by The Director, an elaborate slide show program 
from the Right Answers Group. . . Word Perfect Corp. has established a 
strong presence on CIS and are actively soliciting bug reports from owners 
of the Amiga version of Word Perfect- They have a good number to work 
on (of bu^j that is} but are to be commended for their product support. , . 

Those of you who just can't find a driver for that printer youVe always 
wanted to hook up can roll your own with the PD program prtdrvgen by 
JoegenTfjomsen. It's a lot of work, thou^. There are some 350 parameters 
to fill in from your printer's manual. . . Look for COMAL soon on the 
Amiga. . . Audio Master from Aegis Development is sound sample 
editing software that works with all sound digitizing hardware. It costs 
$59.95 (US). . . SoftClrcuits, Inc., who pretty well have the entire computer- 
aided engineering narket for the Amiga to themselves, also have some 
intriguing PD software available, including a packet radkD communications 
program and a slow scan television prc^ram. . . Byte-ty-Byte have, after 
heavy advertising, stepped making their PAL Jr. peripheral box. Seems 
there iusf wasn't a big enough demand to make it worth while. They will, 

however, still provide full suppoxi for the ones already out there, . , 

' - 1., . " 

Some emendations and corrections to last issue's column: I'm glad to see 
that CBM did post a slight profit in the last quarter and the slock price has 
recovered somewhat to almost $10 on the NYSE. . . The author of the 
Draco compiler for the Amiga is Chris Gray, not Chris Jeffries. . . SoftCir- 



Tho Transactor 



64 



January 1986: Volume S, Issue 04 



cuils" Scheme program sells for $199,95 (US). It is the Phis version that 
sells for $499.95 (US), . . My CIS ID number is not 71425,1646 but 
71426,1646. . , Joanne Park spells her first name with a hyphen. Sorry, Jo- 
anne. . . 

Cheath (Charlie Heath, author of TXeD) is one of the moderators d BIX's 
Amiga forums. He and others are working on arp-ffl>nuT- "^^s library 
will contain all the standard C input and output routines, plus other useful 
routines such as Cheath's getfile requester. Pn^rains can then be cut 
down in size by opening and using arp.library, rather than using code 
added by the compiler Of course, the Amiga running the program has to 
have arp-library in the libs directory on the Workbench disk, . . Cheath is 
also the source of an interesting tidbit of programming info: it seems that 
the RequeslO function, which opens a requester, can return before the 
requester has been fully rendered. If an immediate attempt is made to 
change a gadget in the requester, it may fail. This could be the very reason 
why i could never get RemoveGadge^) and AddGadget() to work in the 
requester I use in my keep prt^ram. I eventually gave up. and simply 
made the changes without removing the gadget concerned first, and then 
called RefreshGadgetsO- It works, if a little crudely, Cheath su^este calling 
a Delayt) function immediately after the Request{) function to ensure that 
the requester has had a chance to be completely rendered in the window. . 



Transformer 1 .2 should be out by the tinrte you read this. Also (xit is the 
reason wt^ Commodore hung on to it for so long. Someone posted it to a 
pirate BBS in the States shortly after it was received at Commodore several 
months ago- Simile Research, the creators of the prt^ram, immediately 
launched a lawsuit against CBM. blaming them for the leak. According to 
Simile, apparently there were only two copies of the program in existence 
al the time it was handed over to CBM: one was in a safe at Simile's lawyer's 
office; the other was given to Commodore. With the resolutbn of the 
lawsuit, the program has been released. (As a side note, the same 
pn^rammers behind Transformer have created PCDitto for the Atari ST, 
which provides PC emulation with cobur graphics. It apparently cannot do 
monochrome,) 

Speaking of emulators. Randy Linden here in Toronto has accomplished a 
rather amazing feat of pn}gramming. He has written a C64 emulator for the 
Amiga that can handle such arcana as raster interrupts, fast loaders and 
code intended for the SD chip- In a recent demonstration at the Transactor 
offices, fjnden's emulator ran every program thrown at it, except for some 
copy protected products, tfwugh not al full speed. Among the programs 
were several that pump the graphics and sound pretty hard. 

Unlike the C64 emulator I have mentioned in previous columns. Linden's 
does not require a hardware interface - unless you call a cable an interface. 
The prt^ram can use a 1 541 connected via the cable to the Amiga's serial 
port, or a regular 3.5" Amiga drive can be used to partition and format a 
portion of a disk in 1541 format. 

The pr(^ram is not an at)sotutely perfect emulation: in addition to the 
reduced speed (roughly half that of the 64, depending on the pr(^ram), 
rapkily changing raster interrupts can cause it to stumble, as well as double- 
wide sprites. Nor does it work with all fast loaders; because they are so 
dependent on liming, Unden has to write custom code for each one. 

At this point, Linden is thinking of selling the pn^ram for $49,95 (Can.), 
$69,95 with the cable. At last, relative files on the Amiga! 

I have been growing rather weary lately of the endless moaning hora some 
quarters about the deficiencies of AmigaDOS or the lack of a cheap, fast 
hard drive, I have pointed out that AmigaDOS has had nowhere near the 
time and money put into its development as Unix or MSDOS. As for hard 

TheTransoctor 



drives, no-one can produce a cheap one for a market consisting d at most 
200,000 machines. The economies of scale just don't come into play 

I was gratified then to receive this response from Chris Siebenmann, 
currently a programmer at Gold Disk: 

''*Sigh. t guess we just haven^t talked recently dxmt the gqod 
aspects of the Amiga, like multitasking, and a system architecture 
thai lei me build a print spooler with three simple programs, or the 
fact that the Amiga (with enough memory) is Just about my ideal 
devebpment enuironment. I know of no other machine on which so 
many neat hacks (PopCLI. OickToFront, FACQ vdO:, and many 
more) could hove been done so transparently and work together so 
well. It's a wonderful system. . . which is why the bad bits provoke 



me so much. 



J' 



,.r 



,ri 



M( L--- ^^^1 ■ — - 



■ I. 



*_ . X ,1 H 



-4s to the hardware. . . amen. When I buy expansion hardware, fm 
gjing to pay extra tor ASDG or Comspec reliability without even 
blinking /fs worth it. R>r what you gel, the prices ARENT out of 
line. Name one other machine with cheap autoconfiguring HDs. I'll 
gfve you a hint . . . it isn't mack by iBM." , , , ., 



C<»iiing up next tiinep . , 



* T 



V . 



t I 



:jji- 



CBM Canada has kindly lent me a 2000 for evaluation. The full report will 
be in the next editbn of Amiga Dispatches, but I can tell you right now, Tm 
thoroughly spoiled. I don't want to have to go back to my 1000. In addition 
to the standard 1 Mb of RAM, this 2000 has a 20 Mb hard disk shared by 
the Amiga and a Bridge card. The hard disk is considerably faster than the 
floppies: a typical compile and link seems to take only about one quarter 
the time it did with floppies. An interesting side^ffecl of having the extra .5 
Mb of RAM is that 1 have started using the Workbench again, rather than 
just the CU- It really shows that the Ami^ doesn't come into its own until 

you have a decent amount of memory to work with. 

^ -. ■ , ,, ,, . 

The 2000 on loan to me is a West German model. As you probably know, it 
will be replaced by the so-called West Chester design, also known as the 
B2000. This has some significant improvements, including a vkieo sbt with 
a higher number of signals available, a 'F^t Agnes' chip and I Mb of RAM 
on the CHIP bus, which opens the door to a possible upgradi? on the 
graphics performance, and a cleaner design overall I hope to be able to 
bring you a review of this nachine as well, Hmmm. Maybe 1 can just get 
CBM to keep lending me review machines. .^' 

By the way Commodore has just published The A500/A2000 Technical 
Reference Guide, which provides complete schematics for the 500, the West 
German 2000 and the West Chester 2000. in-d^th hardware info and 
complete Bridgecard ckxumentalion, including the Janus library calls, it 
can be ordered from Lauren Brown (mistakenly referred to as 'Laurie* in 

my last column - sorry, Lauren) at CBM West Chester in PA, for $40 (US), 

.-■I - ' , , 

Also coming up are reports on the arrival of TeX for the Amiga, version 4 of 
the Lattice C con^iler, and on AmiExpo, the Amiga Exposition to be beM 
October 10-12, in New York. 1 was invited by the organizers to appear on 
one of the user panels but, to my bitter disappointment, could not raise the 
funds to go. So I am dragooning Nk:k and Karl, who are going, into 
grabbing every bit of information they can for me. 

Until then, keep those cards and letters, electronic and otherwise, coming, 
folks. They're appreciated. , 



CIS: 71426,1646 
PeopleLink: AMTAG 
BIX: dispatcher 



GEnie: Lgranlham 

Bloom Beacon BBS: Tim Grantham 

(416 297-5607) 



65 



Jonuory 1988: Volume 8, Issue 04 



TWM 



an 



^ ^ 



I 



A Paneless Approach to Tiny Window Management 

■ by Nick Sullivan -•■^ 



II 1 1 ^ 



. 1 



■*' \k 



-■x 



'. ■?! 




Mosl programs on Ihe Amiga can be divided into three fairly tidy 
classes. The commonest class consists of programs like DfR and 
LIST, that you invoke as commands, that do their work then exit. 
Another class consists of handlers, like the console handier Con- 
Man, or PopToFront, from a few Transactors a;^o. These proi^rams, 
or their offspring, live in the system usually until next reboot but, 
because they require no user interaction, they are invisible. 

Pn:>grams in the third class are the ones you interact with for an 
extended period of time, such as text editors, terminal emulators 
and paint programs, or that you might keep around for sporadic 
interaction, such as PopColours and Structure Browser. One benefit 
of the Amiga's multitasking environment is that you don't have to 
take such programs down in order to do something else. You can 
switch readily from your editor to your terminal, for instance, and 
keep your text in memory; you can switch from the terminal back to 
the editor and stay on-line. 

The extent to which you can lake advantage of this capability 
depends, of course, on how much RAM you have in your system in 
relation to the size of the programs you're running. Even with a lot 
of expansion RAM, though, you are still limited by the amount of 
available "chip RAM" - the special area of memory that the Amiga's 
custom chips can use. On current Amigas, chip RAM is limited to 
51 2K and, while that sounds like a lot, it can quickly get eaten up by 
programs that use lots of windows, colourful screens, gadgets, and 
other display elements that need chip RAM to survive. 

The other problem with running a lot of interactive programs 
simultaneously is that they tend to crowd your monitor screen. That 
makes for a lot of depth-arranging and resizing as you flit from one 
task to another - the infamous "electronic shell-game" - and can 
get pretty tiresome if you have to do a lot of it. A few prc^rams even 
put up a full-size window and won't allow you to get at the 
Workbench screen behind. ^ 

One approach that some programs have taken to relieve the on- 
screen congestion has been to supply a "tiny window mode", which 
can be invoked when the program is not in active use. This idea was 
arrived at independently quite a while ago in at least two programs I 
know of - Rick Stiles' shareware text editor Uedit, and Chris 
Zamara's PopColours. In Uedit particularly, use of the tiny window 
(invoked by clicking on the editor's title bar) achieves a significant 
savings in chip RAM. Using a normal 640 by 200 window on the 
Workbench screen, which has two bit-planes, Uedit needs 32K for 
its bit-map, plus a bit more for gadgets. Its tiny window, however, is 
a mere 100 by 20 pixels in size, and so consumes less than 600 
bytes. Clearly, the chip RAM penalty for running concurrent appli- 
cations would be considerably eased if the use of a tiny window 
mode was more widespread. ' ' ' 



ii I 



■r'Hf 



A tiny window consists of no more than an inch or two of title bar 
with an equivalent thickness of empty window beneath. It is 
draggable, and may be depth arranged (since part of its purpose is to 
keep the application that owns it out of your hair), but not resizable. 
Clicking in the empty part reactivates the parent program, prompt- 
ing it to take the tiny window down, put its working window {or 
screen) back up, and carry on with business as usual. 



^ F ' 

\ 



One reason for this article is to advocate the use of tiny windows in 
programs - including commercial programs - in which their use Is 
appropriate (for one approach to implementing a tiny window mode 
see the listings for 'TWM" and "Testl" below). Suppose this idea 
were generally adopted, though, making it easier to run several 
such programs concurrently. Now the user has another problem; 
the new disorder of TWL (Tiny Window Litter), in which one's 
visible workspace is obscured by annoying swarms of tiny windows 
that continually seem to be getting in your way as you work, no 
matter how much you try to shuffle things around. 

I 

So the other reason for this article is to present TWM. for Tiny 

Window Manager', a small and easily implemented piece of code 
that enables programs to support a tiny window mode while giving 
users a method of avoiding the anguish of TWL, and the consequent 
disruption of their lives. 

From the user's point of view, TWM is a kind of central storage 
compartment in which sleeping programs are housed, and from 
which they can be activated. The programs do not have to maintain 
any display of their own - not even a tiny window, so the user's 
screen is free from clutter. TWM's own working window contains 
gadgets bearing the names of its "client programs". When the user 
clicks on one of these gadgets, the corresponding client program is 
awoken and resumes operation. TWM also has its own tiny window 
mode; when that is in use, the amount of chip RAM jointly 
consumed for graphics by the client prt^rams and TWM itself is 
very smalL When the system is hosting two or more applications 
that support TWM, there is a significant savings in both resources 
and convenience. Of course, even if TWM is not running, applica- 
tions that support it will run normally - but instead of disappearing 
entirely when they go to sleep, they will put up a tiny window in the 
usual way. 

From the programmer's point of view, TWM comes in two parts - 
the program TWM itself, and a short C-language module called 
twmClient.c (also available in Modula 2 - see the review of Bench- 
mark Modula 2 in this issue). The twmClienl code can be compiled 
and linked with any application that supports a tiny window mode, 
l^t us suppose that this client application has been running in its 
active mode but now, as a result of some action of the user's 
(perhaps a menu selection, perhaps clicking on a gadget) it has 



Hie Transactor 



66 



January 1988: Volume 8, issue 04 



taken down its working display and is about to put up its tiny 
window and go to sleep. 



- ^ 



Before taking that step, the application now calls the function 
PostMeO in the twmClient module, passing as an argument the 
name by which it would like to be known, as in: - ■ ■ 

PostMe('PopColours"); - -■ 

PostMe(}, in its turn, searches the system for a public message port 
with the name "TinyWindowManager\ If the search succeeds. 
PostMe() sends a message lo that port with the name of the client, 
and waits at its own message port for a reply. Effectively, the client 
application has now let itself go to sleep and, because it has closed 
its working window, there are no visible signs of its existence. 

The message sent by the client is now picked up by the TWM 
prc^ram, which the user has earlier run, and which is now display- 
ing one of its own windows (either the tiny window or the larger 
working window) on the usefs screen. On receipt of the message 
TWM creates a gadget bearing the client application's name. The 
gadget will be displayed in TWM's working window {immediately, if 
that window is up). There may be other gadgets in the window also 
-one for each client application. This is the only indication that the 
clients still exist and, when TWM is in its tiny window mode, there 
is no sign of them at all. Chip RAM is conserved, and the user's 
window is uncluttered. When the user later clicks on the gadget, 
TWM replies lo the message the client sent, deletes the gadget, then 
forgets about the client altogether. 

Back now to PoslMe(), waiting asleep at its message port for a reply 
to its message. The reply has finally come, signifying that the user 
has selected the client's gadget in the TWM working window, and 
wants the client to put up its own working window again. PostMe() 
now returns to the client, with the value TRUE, and the client goes 
back to work. 

Several things might have gone wrong along the way. The most 
probable of these is that the user may not currently have TWM 
running. A remoter possibility is that TWM might have failed to 
allocate memory for the client's gadget, or could not open a window. 
In all these cases, PostMe() returns FALSE to the client, who then 
knows that it is necessary to put up a tiny window of its own after all. 

As you will see in the code that follows, there are other details. In 
case the client application wishes to wake itself up (in response to 
time-out or some other kind of message) while it is in TWM's care, 
an UnPostMeO function is also provided. Most clients won't need 
UnPostMe(); in that case, the programmer can remove UnPostMeO 
from twmClient.c to shrink the code even further. Another detail is 
that TWM remembers where the user last placed its windows, and 
restores them lo the chosen position each lime they are re-opened. 
Uedit and PopColours also have this feature, and it is recommended 
that other tiny window programs include it (see the pertly named 
SavePosCloseWO function below for sample code). 

The intent of TWM is lo institute a standard of which all hny window 
programs can take advantage. Therefore all the following code is 
freely redistributable, and may be used in any program - PD, 
shareware, or commercial. New versions of PopColours and the XE 
expression evaluation program from Transactor's Amiga Disk ^'l 
now support TWM, and will be available on CompuServe's Amiga- 



Forum, along with TWM itself, by the time this magazine is in your 
hands. They will also appear on our second Amiga Disk, which 
should be out in January, 



LISTING 1:TWMX 



/- TWM.c 



'.' I _■' 



Tiny- Window Manager v1 .0 (c) 1987 Transactor Putjiisliing Inc. 
by Nick Sullivan 

This program is freely redtslnbuiable provided that no charge is made 
tor ir^e redistribution beyond reasonable reproduction costs, and thai no 
changes are made except with the prior written approval 0l Transactor 
Publishing \no.. 85 West WjImotSl *1 0, Richmond Hill, Ontario L4B 1 K7, 

TWM providesastoragearea in which applicaiions that are inactive, but 
running, can wait to be re-activated without using any chip RAM. It thus 
provides an alternative to the "tiny window" approach to minimizing chip 
RAM use, as exempl<tied by such programs as Uedit and PopColours. 

When TWM is run, it puts up its own tiny window, and creates a public 
message port. Client applications should check for the existence of Ihis 
port and, if it is present, send a "twMessage" [as defined in twm.h) with 
the twm^ction field set to TWM_ACT]ON_ADD when they wish to go to sleep. 
When TWM's tiny window is clicked in thereafter, a larger window will be 
put up containing gadgets bearing the names of each cJieni application 
that has been added. Clicking on one of these gadgels will cause the 
twMessage to be replied to, which is the signal for the client to l . . 
reawaken. At the same time as the reply is sent, the iarge TWM window will 
be taken down, and the gadget for that client removed, , 

If a client wishes to reactivate itself beJore its TWM gadget is 
clicked, or if it wishes to exit altogether, it should first send a ■ ■ \' 

twMessage with the twm_action field set to TWM_ACTI0N,DELETE. 

The twm^action field is used by TWM to return a code lo the client that 
indicates whether The requested operation was successful The code for 
success is E_GK. Other possibilities are; 

H_NO_rvTEM A client has asked TWM to add a gadget, bui TWM 

was unable to allocate memory for the gadget structure. 
E_AaANDON_SHIP 1) A client has asked TWM to add a gadget while 

TWM has its large window up. in this case, TWM closes the large window, 

and re-opens il after rethinking the gadget positions and the window si^e, j 
2) The user has clicked on TWM's tiny window, or closed us large 

window, causing TWM to close the current window and attempt to open the 

other one. 
if the window open fails in either of these cases, TWM sends all 

current clients this error message, then exits, since it has no means ^ ^ 

of recovery. 
E_TASK_UN KNOWN A client has sent a TWM_ACTfON_DELETE, but TWM 

does not currently have a gadget for that client 
E J\CTION_UNKNOWN A message has been received with the twm_aclion field 

set to an unknown code, . currently the only possibilities are 

TWM_ACT]ON_DELETE and TWM_ACTION_ADO, 



Sample C code for applications wishing to interface correctly with TWM 

IS contained in the tile twmClient.c, The header file Twm.h is also 

required. Before using other functions in this file, the client should 

call PostMe(). supplying as an argument the name that should appear on its 

gadget in the TWM window. The name can be up to GADGNAMESIZE - 1 

characters in length (currently 16 characters); excess characters are 

removed. 

The function Postfvle() in twmClient.c should be called when the 
client wishes to deactivate. If this function returns TRUE, the client 
should resume its life as an active application. If it returns FALSE, 
either TWM is not present in the system or else the attempt to post failed 
for some reason In this case, the client should take an alternative 
approach to deactivated living (like making its own tiny window), or efse 
not allow Itself to be deactivated. 

Programs that wish to be able lo receive messages even when deactivated 
(time-outs, for example), will need to use amodified version of PostMe(). 
If such a program wishes to reactivate before its gadget has been clicked 
in the TWM window, it should first call UnPostf^ej) (no arguments, no 
return) to inform TWM that the gadget should be taken down. Programs that 
wHI NOT need to call UnPostMeO (i e. most programs) can use a version 
of twmClient.c from which the UnPostMe() function and all references to 
the global variable Delmsg have been removed 

Before the first call to PostMe(), the function twmlnit() must be 
invoked to set up the required messages and ports that PostMeO will need. 

Before the client exits, it should call the (unction UnPostMe() to 
deallocate resources twmlnit() has allocated. 



I' 



-/ 



#include "header/twm h" 

/■ This invis<ble gadget lives in TWM's tiny window When clicked on, the 
tiny window is removed and TWM's working window is opened- */ 
struct Gadget WakeUpGadget = { ' " ' 



I- 






The Tronsoctor 



67 



January 1968: Vdlume 8, Issue 04 



NULL, 

2,10,116,10, 

GADGHNONE. 

RELVERIFY, 

BOOLGAOGET, 

NULL. 

NULL, 

NULL, 

0, 

NULL, 

0. 

NULL, 



/. address of nexi gadget 

/■left, top, width, height 

/-flags- no highlighting 

/-activation flags 

/- gadget type 

/• no imagery 

y- no alternate imagery 

/' no text 

/■ mutual exclude 

f' Special Info 

/- gadget ID 
/- user data 



}; 

struct NewWindowwtiny = { 



/. 
/• 
/• 



left, top, width, height 
detail pen, block pen 
lOCMP flags 



480,60,120,20, 

0, 1, 
GADGETUP 
I CLOSEWtNDOW, 
WINDOWDRAG 

WfNOOWCLOSE 

WINDOWDEPTH, 
&WakeUpGadge!, /- application gadget list 



-/ 
-/ 
-/ 
./ 
-/ 
-/ 
t/ 
-/ 
W 
./ 
•/ 

w 



-/ 



fji'' 



Ti'i' 



-- - n 



*'<. 



I' Window flags 



NULL. 

(UBYTE-)'™M'. 

NULL, 

NULL, 

0, 0, 0, 0, 

WBENCHSCREEN 



}; 

struct New Window whuge = { 



/- special checkmark imagery 
/- window title 
/* custom screen pointer 
/• super bitmap pointer 
/• min/max width and height 
/" screen type 



430,60,0.0, /. 

0, 1, /. 

GADGETUP 

I CLOSEWINDOW, /. 

WINDOWDRAG /. 
WINDOWCLOSE 
WINDOWDEPTH 
SMART REFRESH, 

NULL, /• 

NULL /. 

(UBYTE -)"TWM-, /. 

NULL, /. 

NULL, /• 

0. 0, 0, 0. /- 



left, top, width, height 
detail pen, block pen 

IDCMP flags 
Window Nags 



./ 
./ 
W 
-/ 
•/ 
-/ 



./ 
-/ 



application gadget list 
special checkmark imagery 
window title 
custom screen pointer 
super bitmap pointer 
min/max width and height 



WBENCHSCREEN /-screen type 



-/ 
W 
-/ 

-/ 
-/ 
•/ 



I; 

struct TextAIIrlwmFont = { /• SO column topaz Jont 
{UBYTE.)"topazfonf, 
TOPAZ_EIGHTY, 
FS^NORMAL, 
FPF^ROMFONT 

1; 

SHORT borderlines[5][2] = { /- simple box around gadgets 

-3 -3 J 

GAOGWIDTH + 3. -3 (! 

GAOGWIDTH + 3. GADGHFIGHT -f 2}, 

-3. GADGHEIGHT-f 2}, 

-3. -3 J 

I- 

t' The fdlowing is the default contents of a client's gadget -/ 

struct twmGadgefgadgTempiate - { 

/- intuition gadget structure •/ 

NULL, 

0, 0, GADGWJDTH, GADGHEIGHT 



GADGHCOMP, 

RELVERIFY, 

BOOLGAOGET 

NULL, 

NULL, 

NULL, 

0, 

NULL, 

0, 

NULL. 

/• intuption border structure •/ 

0,0, 

2, 0, JAMl, 

5, 

(SHORT -)borderlmes, 

NULL, 

/• intuitext s^uclure •/ 

1,0, JAMl, 

0,1. 
5,twmFont, 

NULL, 

NULL, 



I'. 



/• address of next gadget 

/- left, top, width, height 

/• flags- invert to highlight 

/" activation flags 

/- gadget type 

/- address of border struct 

/- SeieciRender 

/- address of intuilext struci 

/-mutual exclude 

/- Special Info 

/• gadget ID 

/* user data 

/- left edge, lop edge 
/- front, back pens, draw mode 
/- number of points in border 
/• address of coordinate array 
/- address of nexT bordw 

/* front, back pens, draw mode 

/-left edge, top edge 

/* address of TextAttr struct 

/' pointer to text 

/• address of next IntuiText 



/- name of gadget as supplied by client •/ 



^- 



/■ pointer to message that requested this gadget •/ 
NULL 



}. 



extern VOID -OpenWindowO, -OpenLibraryO, 
extern VOID -CreatePor1(), -FindPortO; 
extern VOID -GetMsgO, -AllocMem(): 



k- 1 'I J .•! 



r -J 



ii , 



-J 



Struct IntuitionBase -IniuitionBase; 

struct twmGadget ■ NewGadgel(); 

struct MsgPorl tmp; /■ public port (called PORTNAME) '! 



struci NewWindow -nw; h describes current window 
struct Window tw; /• pointer To current window 

struct twmWessage -Tmsg; /• message arrived at mp 
struct Intuifvlessage -Imsg, /- message arrived at IDCMP 
struct twmGadget -twmg, /- first gadget in my list 



•/ 
-/ 



. , 



■ i 



main() . ,. ' 

{ 

register iniexitflag; 

register intswapflag; 

register inttinyflag; 

register UWORD class; 

UWORO code, 

int gadgCounl; 



,'k, \, 



/-quit input loop if set ' ■ 
/- use other window (tiny/huge) 
/' currently using tiny window 
/' IDCMP message class 
/* IDCMP message code 
/- # of gadgets in my list 



■-/ 
-/ 
•/ 
■/ 

'*/ 
W 
/ 



.-. \ 



• t 



register struct twmGadget -gadget; /- gadget clicked in huge window 
exitflag - FALSE; 

swapflag = FALSE: 
tinyflag = TRUE; /- starloutwith Tiny window •/ 

gadgCount =0; ' ' " ■' ' - ■ 

it [{IntuitionBase = Open Library( "intuition. library', 33L)) == NULL) 

CloseStuff(E_OPEN_INTUI), 
if [FindPort(PORTNAME) i = NULL) /- it we already exist, quit •/ 

CloseStuff(E_ALREADV_U P); 
il((mp = CrealePorl(PORTNAME, OL)) -- NULL) 

CloseStuff(E_OPEN_PORT), 
it((w - OpenWindow(nw = &wtmy)) -= NULL) 

CloseStuft(E,OPEN_WINDOW); 
/• exitflag set by close gadget on tiny window if no current clients W 
while {'exirtlag) { 

/• waiting for message at IDCMP or our own port -/ 

Wait(l L « w->UserPort->mp:^igBit 1 1L « mp->mp_SigBit); 

v^ile (Imsg = GetMsg(w->UserPori]) { /t check tOCMP messages first •/ 
class = lmsg-X;iass; 
code = Imsg-X^ode; 
gadget = (struci twmGadget •)lmsg->IAddress; 
ReplyMsg(lmsg), 
if(class== CLOSEWINDOW) 
/- exit from tiny window only if we have no ciients. else beep •/ 
if (tinyflag) 
if (gadgCounl ==0] 
exitflag = TRUE; 
else 
D isplay Beep( w- > WScreen); 
/• close gadget on huge window means switch back to liny ■/ 
else 
swapflag = TRUE; 
/- this message means gadget pressed in huge window •/ 
elseif(class== GADGETUP) 
if (tinyflag) 
r swapflag = TRUE; 

else I 
gad8el->tgMessage->lm Action = E_OK; 
. KillGadget(gadgel->fgMessage, TRUE); 
gadgCount--: 
swapflag = TRUE; 
Re ply M sg(gadgei->tgMe ssage), 

} 

} 

/• now check messages at our public port -/ 

while (Tmsg = GetMsg(mp)){ 
/* client going on vacation, create a gadget for him -/ 
if (Tmsg- >tm Action == TWM_ACTI0N_ADD) { 
if ((gadget = NewGadget(Tmsg)) == NULL] { 
Tmsg- >imAct ion = E,NO„WEM; /• send regrets *f 
Reply Msg(Tmsg); 

L 

etse 

gadgCount+ + : 
/• if the huge window is up right now, close and re-open 

EOthat we can be sure the new gadget will fit •/ 
if(!linyflag)| 

SaveP(KCIoseW(nw, w); 

CalcGadgPos(nw), 
-■ '^ rfflw - OpenWindow(nw)) == NULL) 



J ■ I 



/t return code E_OK-/ 
/- get rid of gadget -/ 



/t swjtchtotiny 
/• inform ciient 



./ 



-,j- 



ThoTransodoT 



Jonuary 1986: Vblutne a, lisuo 04 



} 



aoseStu!f(^^BANDON^HIP); 



y r ■ I 



r r .z. 



fc'« +* ■ 



- .!■>. 



) 

/• client going righr out of business, cancel his gadget •/ 

e<seif(Tmsg->tmAc[ion == TWM_ACTlON_DELETE) { 

/' kilf the gadget, and ghost it \t huge window is up </ 

ff (KillGadget(Tmsg, llinytfag)) | 
Tmsg->lm Action - E_OK; 

gadgCount-s 

J . - it-'- -•" ,^" 

e\se "-"■ " -"' 

Tmsg-MmAchon ^ E TASK^UNKNOWN,/- unrecognized dient •/ 

RepfyMsg(Tmsg), 

J ■ ■ -5 ■.'. I ■ -- ^ 

/• some message Jype we don't know •/ 
else j . r _' . 

Tmsg->tmAction - EJVCTI0N_UN KNOWN; 

RepfyMsgfTfTisg); 

} 

S {swapflag) { /■ swilch between huge and tiny windows •/ 
swaptlag = FALSE, 
SavePosCloseW(nw, w); 
nw ^ tinyflag ? &whuge . Siwtiny; 
tinyflag - ftmyflag: 
t* if we're go^ng to open huge window, reformat 

gadgets and recalculate the window si?e ■/ 
rf(! tinyflag} 

CalcGadgPos(nw), 
rf((w = OpenWindow(nw)) == NULL) 

CloseStuff(E_ABANDON_SHlP); 

! 

I 
CloseSlLjff(E_OK); 



/- CloseSliiff 

Cbse and deallocate everything. If there are any active clients, that 
meanssomethtnghasgone wrong, so we send them an E_ABANDON_SH]P. 
The return error codes start at 500 as defined in twm/header.h 

-/ 

CloseSfuff (error) ini error; 

{ 

register struct IwmGadget -g; 

g = twmg; 

if (w) CloseWindow(w}: 

if(mp) DeletePorf(mp); 

if (IntuilionBase) ClOSeLibrary(lntuilionBase); 

while(gi= NULLH 

g->fgMessage->irnAction = EJ\BANDON_SHIP; 

R epty M sg (g - > ig M essage) , 

KitfGadgel(g ->lgM essage) , 

I 

exiy error), 

I 

/■ NewGadget 

We have a new client to create a gadget for We link him lo the 
NextGadgel field of the last gadget on the list, set up the new gadget 
and return its address, 

struct twmGadget -NewGadget (msg) 
struct twmMessage -msg; 

{ 

register struct twmGadget -g, "gprev; 

register char -clienTname; 
register char c; 
gprev= NULL; 
g = iwmg; 
while(gi= NULL){ 
gprev ^ g; 
g = g->tgMynext; 

) 

it((g = A|locMem((long)sizeof(Struct twmGadget). OL)) -= NULL) 

return FALSE; 
if (gprev '= NULL)! 
g pre v->tgMy next - g, 
gprev-MgGadget.NextGadget = &g->lgGadgel; 

I 

-g = gadgTemplate; 

clientname = ms9-->tmName + strlen(msg->tmName); 

while [clieniname > msg->tmName 

&&(c = .(cltenlname'1))1= ':' 

■ &&C!='/') 
clientname — ; 



} 



strncpy(g->1gName, clientname, GADGNAMESIZE -- 1); 

g->tgGadgel.GadgetRender ^ (APTR)Ag->tgBorder; 

g->tgGadgel.GadgetText = &g->tglText; 

g->tgHext LeftEdge = (GADGNAf^ESIZE - strlen(g->tgNamej) « 2. 

g->tgfText.lText = (UBYTE .)g->tgName; 

g->tgWessage = msg; 

if(twmg == NULL) ■' ' 

twmg = g; *' "* 

return g; 



ii- ■- 



i„ . 1 



« IL 



^ 



4 r 



^ t 



I ■ - 



|1 



■ i' 



.■I'-T^ 



I ii 



. „ •-.<-^ 



/- KillGadget 

Get rid of a gadget currently on our list. If off Jlag is true, the 
gadget is currently being displayed, so we'll ghost it Return FALSE 
if the gadget is not on the list 

•/ 

KillGadget (msg, offjiag) 

struct twmMessage -msg; int off Jlag; 

register struct IwmGadget -g, 'gprev, 
int flag; 
flag ^ FALSE; ' ^ 

gprev = NULL; 
g = Iwmg; 
while(gi= NULLa&iflag) 
it (g->lgM essage- >im Message ma,ReplyPort =- 
msg- >im Message, m n_Re ply Por i) 
flag = TRUE; 
else{ 
gprev= g; ' ' 

g = g->tgMynext: 

if (flag) { 

if (oft Jlag) 

OffGadget(&g->IgGadget, w, OL); 
RemoveGadget(w, &g->tgGadget); 
i!(gprev!= NULL) 

gprev->tgMynext = g->lgMynexl; ' ^ *' '^^lyi^J^ ^■ 

else 

twmg - g->lgMynexi: "- ■ "• 

FreeMem(g, (long)sizeof(stTUcT twmGadget)); 

return flag, 

/< CalcGadgPos 

Position the gadgets in the huge window, and set the window ' 

size to accommodate Ihem. The gadgets are displayed four 

across, to the maximum depth of the screen. 
W 

CalcGadgPos (nw) 
register struct NewWindow -nw; 

f . . . 

register int I, x, y; 
register struct twmGadget -g: 
I =0; /» gadget counter •/ 

X = GADGHGUTTER + 2; /- starting x position •/ " 
y = GADGVGUTTER + 10; /- starting y position •/ 
g = twmg; /- address of 1st gadget •/ 

/• chain through gadget list, writing in new left and top •/ 
while (g) ! ^ ' 

g->igGadget LeftEdge = x; 
g-'>tgGadgel. Top Edge - y; 
/- if this gadget is in R.H. column, reposition lo left of next line-/ 
if((i + +&3)== 3}{ 

X = GADGHGUTTER + 2; 

y + = GADGHEIGHT + GADGVGUTTER; 

} 

X + = GADGWIDTH + GADGHGUHER; 
/- chain to next gadget -/ 
g = g->tgMynext; 

i' if there are no gadgets, make the window big enough to hofd ^ 'f 

X - GADGHGUTTER - 2 + GADGWIDTH + 2; 
/- rf less than 4 gadgets, make window just big enough to hold them -/ 
if(i<4) 

nw->Width = x; 
else /• otherwise make itfull width -/ 

nw->WpdIh - GADGHGUTTER -f 2 + (GADGHGUTTER + GADGWIDTH) • 4, 
/• if the last gadget on the list falis at the R H. edge of 

the window, y is already big enough; otherwise, make it so </ ' 

if((i&3)==0) 

nw->Height - y; 



'i^ 



.* 



The Transoetor 



69 



January 19S8: Voluim 8, Issue 04 



eise ' ■ 

nw->Heighf = y + GADGVGUTTER + GADGHEIGHT; 
I' make sure that new dimensions of wmdow will slill lit 

on the screen if necessary reposition the window -/ 
rf(nw-->LeftEdge + nw->Widfh >w->WScreen->Width) 

nw->LefIEdge = W'>WScreen->Widtln - nw->W[dth; 
(f (nw->TopEdge + nW'->Heighi> w->WScreen->HeighO 

nw->TopEdge = w->WScreen->Height - nw->Heighl: 
/< install our first gadget as the new window's first gadget ■/ 
nw->FirslGadge! - &twmg->lgGadget; 



/* SavePosCtoseW 

Save the current window position and size in the NewWindow 
structure for that window, then dose the window. 



1- 



- I _ 



,. .!■ .* 



-/ 



SavePosCloseW (nw. w) 
register struct NewWindow <nw; 
register struct Window -w, 



I 



} 



nw->Le1tEdge = w->LeflEdge: 
nw->TopEdge = w->TopEdge: 
nw-'> Width = w->Width, 
nw->Heighl = w->Height; 
CioseWindow(w); 



/• When compiling with Aztec, the following two stubs replace the Aztec 
code for parsing the command line, thus reducing code size a bit •/ 

#i!defAZTHC_C 
_wb_parse(){} 
_clLParse(){} 
#endif !AZTEC_C 



LiSTiNG 2: HEADER/TWM.H 

/' headefytsvm,h 

This IS the same header file for both twm c and twmClient.c. 

However, the intuition include is not needed for twmCtieni. 
and can be omitted to reduce compilation time. 

#1 ncl ude <intujt lon/intuit ion base . h > 

^include <exec/types.h> 
^include <e>;ec/memory h> 
^include <e>!ec/porls.h> 

Wine I ude <exec/lisEs.h> 

^define PORTNAME (TlnyWindow Manager") 
#detine GADGNAMESIZE 17 
#defineGADGH GUTTER IB 
#define GADGVGUTTER 10 
#define GADGWIDTH (GADGNAMESIZE«3) 
#deline GADGHEIGHT 10 

I' commands passed in twm action Held of a twmMessage •/ 
ffdefineTWM ACTIGN_ADD 
#deline TWM_ACTIGN_DELETE 1 
/• return codes passed back in same field ■/ 
Adeline E_OK 

#de(ine E^OPEN JNTUI 501 

#detine E_ALREADY_UP 502 

Adeline E_OPEr^_PORT 503 

#defineE OPEN WINDOW 504 

ffdefine EJECTION UNKNOWN 505 
ffdefineE TASK UNKNOWN 506 
#defineE NO MEM 507 

tfdehne E_ABAND0N,SH1P 508 

struct twmMessage { 
struct Message tmMessage. /■ Exec message structure </ 



char -tmName; 
ini tm Act ion; 



}; 

Struct twm Gad get { 
struct Gadget 
struct Border 
struct IntuiText 
char 

struct twmMessage 'tg Message; 
stT uct twm Gad get tig M y ne>it; 

)i 



/•the client's gadget name-/ 

/• add or delete gadget </ 



T __ 



tgGadgei: 

tg Border; 

tglText. 

tgName[GADGNAMESIZE]; 



/•the gadget for a client -■/ 

/• box around gadget </ 
/•text in gadget W 

/• string for I ntuitext •/ 

/' msg to reply on click •/ 
/- my link to next gadget •/ 



LISTING 3: TESTIS 



/' tesE1 .c 



This is atest program for TWM, and provides an example of using twmClienl 

in an application. It puts up a window named "Press any key'; if a key is 
pressed, the window is taken down, and is replaced by either a tiny window 
or by a gadget in TWM's window (if PostMe() returns TRUE). Clicking in 
the main part of the tiny wtndow kills it, and brings the big window back. 
The same applies to the gadget in the TWM window, if it is being used 
instead. cNcking on it kills it and bring up this program's big window. 
Clicking close in either the big or the small window exits the program. 

The compiled testt program may be copied to test2, lestS etc, and all 
copies run simultaneously, to get a better idea of how TWM works. 

Under Aztec, put this program and twmClient c in the current directory, 
and twm,h in the subdirectory "header', then compile and link thus. 



cc + Htwm p header/twm.h 
cc +Itwm.ptesi1 

cc +ltwm.ptwmClienl 
In tesll .0 twmClienl.o -Ic 



#include "header/twm.h' 



'^h', ? 



/■\ /f'\ 



> U' 



-ll 



HI ■' : 



.•-• 



- I 



rr II l\Jlu^Jl_H i i^jun-^ljij ltti i h.i i ^,-, 

#define HUGE_WINDOW_NAME ([UBVTE tj'Pressany key") ,r 


Struct NewWindow wtiny = 


1 -...,... 


1 


260,130,120,20, 


/' lefLtop, width, height 


•/ 


0. 1. 


t* detai pen, bock pen 


-/ . 


MOUSEBUTTONS 


MDCMPtags 


v 


CLOSEWINDOW, 


' '.i i'n* : "■ 


^ .■-...■ 


WINDOWDRAG 


/" Window flags 


./ 




WINDOWCLOSE 








WINDOWDEPTH 




. 




SMART REFRESH 








ACT VATE, 






NULL, 


/• appication gadget ist 


-/ 


NULL, 


/• specia checkmark imagery •/ 


NULL, 


/•window tit e r 


./ ' 


NULL, 


/• custom screen pointer 


-/ 


NULL, 


/■ super bitmap pointer 


•/ - 


0,0,0,0, 


/• min/max width and height 


./ 


WBENCHSCREEN 

1; 

struct NewWindow whuge -■ 


/• screen type 


./ 


-{ 


+ 


280,120,360,60, 


!* ieft, top, width, height 


-/ 


0, 1, 


/• detai pen, block pen 


-/ 


CLOSEW NDOW 


MDCMPfags 


*/ 


RAWKEY, 


— 




WINDOWDRAG 


/■ Window flags 


•/ 




W NDOWCLOSE 








WINDOWDEPTH 








SMART REFRESH 


■x 






ACT VATE, 








NULL, 


/• application gadget fist 


./ 


NULL, 


/■ specia checkmark imagery -/ 


HUGE WFNDOW NAME, /■ window tUle 


./ 


NULL, 


/* custom screen pointer 


-/ 


NULL, 


/■super bitmap pointer 


•/ 


0,0,0,0, 


/» mm/max width and height 


■' V. 


' 


WBENCHSCREEN 


/■ screen type 


•/ - 






^\ 



,'^f' 



f . 



^ 



1; . 

e>!tern VOID -OpenWindowO, -OpenLibraryO. -AllocMemO, -GetMsg(); 
struct IntuitionBase "InfuitionBase = NULL; ., . ■■■ 

struct NewWindow -nw = NULL; 
struclWindow "W = NULL 

struct IntuiMessage-Imsg = NULL 



main(argc, argv) 
inlargc;char"argv; 

ini exitllag; /■ true when close gadget has been pressed 

inl swapflag, /* true when it's time to switch between windows 

ini tinyftag; /' true when the trny window is up 

UWORD class, /■ I OCMP message class ■ 

UWORD code: /■ IDCMP message code 

chartilename[31]; 

register int i, c; 

/- Use program name as title of tiny window •/ .-■ 

for(i = s[rlen(afgv|0|)-1, 

i>0&fi(c = argv[0][i-l])1= '/&&ci= '/'; i— ) 



■,!' 



t/ 
• / 
./ 
•/ 
./ 



|J_^ 



Wtiny. Title = (UBYTE ■)(&argv( 

it ((In tuition Base = OpenLlbrary("intUJtion.library", 33L)) 

CloseStuff(E,OPEN_INTUI), 
/• Let twmClient do its allocations. . we don't care this 



NULL) 



( - 



The Trantoctor 



TO 



Jonuafy 1M6: Vcriumo 6, Issue 04 



tfflWS 



- ^-,- --^-.b'-l 



■T=aj>fflr4rft,T^^ 



I 



time, bul it returns FALSE if the allocations fail •/ 
lwmlnit{); 
/• initialize flags-/ 
tinyflag = swapflag = exitflag = FALSE; 

h open the big window, and save pointer to its NewWindow struct •/ 
if((w = OpenWindow(nw = Swhuge)) =- NULL) 

CloseStuff(E_OPEN_WINDOW); 
while (fexitflag) { /■ IDCMP loop t/ ^ ■ 

Wait(1L«w->UserPort->mp_SigBit), -. 

while (imsg = GetMsg{w->UserPort)) 1 
class= lmsg->Class; 
code= lmsg->CQde; ' 

Reply Msg(Jmsg); 
if (class =- CLOSEWINDOW) 

exitflag = TRUE; ' " 

/- swap jf tiny window cficked, or key pressed in bfg window ■/ 
else Jl [(class == WOUSEBUTT0NS&&C0de == SELECTUP&& tinyflag) 

||class== RAWKEY) 
, swaptlag = TRUE; 

} 

it [swapf lag) { 

swapflag = FALSE; 

/■ remember where this window is now stationed, and close it -/ 

SavePosCloseW(nw, w); 

/- if tiny window is now up, or PostMe(] fails, open other window •/ 
if(linyflag || iPostf^e(wliny. Title)) | 

nw - tinytlag ? Siwhuge '. Swtiny; 

tinyflag = llinyflag, 

it|(w = OpenWindow(nw)) == NULL) 
ClOseStuff(E_OPEN_WINDOW); 

1 

! 
CloseStuft{E_OK); 



/' CloseStuff 

Call twmCleanUpO to deaffocate messages and port we've been using, 

then close our own stufE and exit, 
W 

CloseStuff (error) 
int error; i' errors start at 500 (see twm.h) except for E_OK = */ 

I 

twmCIeanUpO, /■ twmCfient deallocations-/ 

it(w) CloseWindow(w); 

if (Intuit ion Base) CloseLibrary(lntuition6ase); 

exit(error); 

) 

/' SavePosCIoseW 

Save the current window position and size in the NewWindow structure for 
that window, then close the window. 

static SavePosCfoseW (nw, w) 
register struct NewWindow -nw; 

register struct Window 'W; 

i 
nw->LefTEdge= w->LeftEdge; 

nw->TopEdge= w->TopEdge, 

nw-> Width = w-> Width; 

nw-> Height = w->H eight; 

CioseWindow(w); 

} 



LISTING 4: twmCllent.c 

/• twmClient.c 

Tfny-Window Manager vl ,0 
Client Interface Module 
by Nick Sullivan 



(c) T987 Transactor Publishing Inc. 



This program is freely redistributable provided that no charge is made 
for the redistribution beyond reasonable reproduction costs, and that no 
changes are made, except with the prior written approval of Transactor 
Publishing Inc., 85 West Wilmot SI. #10. Richmond Hill, Ontario L48 tK7 
Programs that incorporate this code should include in their documentation 
the line. This program supports TWf^ ((c) 19S7 Transactor Publishing Inc.)' 

This module should be compiled and linked with applications that wish 
to be clients of TWM when ii is present in the system. Briefly, the client 
calls the function twmlnit() to set up, afterwards calls PostMe() whenever 
he wishes to go to sleep, then finally calls twmCleanUp() |ust before 
exiting. Full details are in the prefatory comments to TWM.c. Note that 



?/ 



the size of this module can be further reduced, especially in programs 
that do not require UnPostMe(); for details see comments in the code. 



^r 



^include "header/twm.h* 

Adeline TWM^MSGSIZE ((long) si zeof (struct twmMessage)) 

e!<lernVOlD"CreatePort(),-FindPort(); '- '■ ' ^ 

extern VOID tGetMsg(), -AllocMemO; 

struct MsgPort 'mp = NULL; /» replyportforourmsgs •/ 

struct fyisgPorl 'twmport = NULL; /■ points to twm's port ■/ 

struct twmf^essage ■Addmsg= NULL; MWM_ACTION_ADD message •/ 

/- The following line can be deleted if UnPoslf^e() is not required. -/ 

struct twmfylessage 'Delmsg = NULL; /• TWM^CTION^DELETE message -/ 

inltwmReady = FALSE, /• TRUEmeansportsareallocated&initialized -/ 



PosiMe (clientName) :> • 

register char -clientName; 

/• trying not to pass junk to TWM. . . this if-stafement can 
be deleted after the client application has been debugged. •/ 

If (ClientName == NULL 1| ■clientName -- '\0') 

returnFALSF; ■' ■ ' -■■- ' '■'' "- ' 

/" check we're initialized and that TWM exists in system, , , 

the first condition in the if-statement can be removed 

after the client application has been debugged ■/ 
i1(!twmfleady||(twmport ^ FindPort(PORTNAME)) =^ NULL) 

return FALSE; . . . ., . ■ i.. - ■ .i ,i .^ ■ .- 

f' set up our message telling TWM to add its gadget </ 
Addmsg->tmName = clientName; 
Addmsg->tmAction = TWMJ\CTIONJ^DD; 
PutMsg(twmport, Addmsg); ... .... 

/•The remainder of thfs function would need to be modified if ' * 

the client wants To be able to re-awaken on some stimulus ' ; 

other than the user clicking its gadget in TWM's window. ■/ 
WaitPort(mp); ,; , . " , , 

Addmsg = GetMsg(mp); 

/• anything other than E^OK return code is bad news. . forget about TWM -I 
return (Addmsg ->tm Action -= E_OK); 

} 



.1- ^T.iv;.' 



V 



1-. 



■t- 



Tf 



.r»v 



■'-i; 

v;,* 



/• The following function can be deleted in normal use ■/ . . , . , ,. ■ , 
UnPostMeO 

{ 

if(lwmReady&&(twmport = FindPort(PORTNAME))f= NULL)| 

Delmsg->tmAclion = TWM_ACTION_DELETE; 

P utf^ sg(t wm por t, Del msg); 

/• TWfvl will reply the original (ADD) message before repaying this one 

if it's going to reply it at all hence loop exit condition »/ 
do{ 

WaitPort(mp); 
I while (GetMsg(mp) ' = Delmsg); ■ r. :. ■■ 

,' 

/• This function must be called by the client before calling PostMef ) •/ 

twmlnitO 



if (twmReady) /■ don't re-imtialize "t i . ■ - 

return TRUE; 
/• set up our messages, allocate a port. The allocation of Delmsg 

can be deleted if the UnPostMe() function is not required •/ 
if((mp = CreatePort(NULL, OL)) == NULL 

(Delmsg = A1locMem(TWM_MSGSIZE, MEMF_CLEAR)) == NULL 
(Addmsg= Alloc Mem(TWM_MSG SIZE, MEr^F_CLEAR)) -= NULL 

){ 
twmCleanUpO; 

return FALSE, 

I 
el5e{ 

/- the next two lines can be deleted if UnPosiMe() is not required. -/ 

Delmsg->tmMessage.mn_ReplyPort = mp, 

Delmsg->imMessage.mn„Node.ln_Type = NT_f^ESSAGE; 

Addmsg->tmMessage.mn_ReplyPort = mp, 

Addmsg->tmMessage.mn_Node.ln_Type = NT_r^ESSAGE; 

return (twmReady = TRUE); ■ ' 

} 



, h4 \Y 



.-'I 



) 



/- This function must be called by the client before it exits. •/ 
twmCleanUpO 

{ 
twmReady = FALSE: 

if(mp) Delete Por t(mp): 

if (Addmsg) F re eM em (Addmsg, TWM_MSGSIZE): 

t" the next line can be deleted if UnPostfyle() is not required. "/ 
if (Delmsg) FreeMem(Delmsg, TWM_MSGSIZE); 

} 



"!■ 



hl^ 



Tlw Transactor 



71 



January 1998: Vblume 8, Issue 04 



By Larry Phillips 



m.i f 



* ^^' 



Larry Phiffips is an Amiga hardware and software hacker from 
Vancouver, British Columbia, and a SYSOP on CompuServe's 
Amigafbrum. This is the first instalment of a regular column in 
which Larry talks about. . . well, whatever is on his mind. You may 
not always agree with his opinions, but we hope you 7/ enjoy his 
discussions on a wide variety of mostly Amiga-related topics. 



Do you remember when the personal computer came onto the 
scene? When the first home colour machines became available? The 
first hard disk drives? How about software? Desktop publishing? All 
of these advancements in the capabilities of the home computer 
have been welcomed by enthusiasts. For months or years, the 
buzzwords f!ew, refinements were anticipated, people wondered 
when their own machine would be capable of such marvels. 

There is a new wave of buzzwords now, and you will be hearing 
them more and more in the next few years. The buzzwords have to 
do with "multitasking'*. The reason you will hear more about this is 
twofold. The first is that machines are becoming powerful enough, 
and fast enough, to make it worthwhile. The second reason is that 
the big players in the game will be introducing multitasking ma- 
chines, and of course will, as usual, claim not only that they 
invented the technique, but that their particular implementation is 
the best. We all know who these companies are, and in fact they 
have already started the wheels in motion. IBM has announced the 
PS/2 line, and Apple has announced their Mac IL Of course the 
operating system for the PS/2 line is still vapour, and the Mac 
doesn't have the MMU yet, but they are coming. 

I am confident that IBM will pretend they invented multitasking, just 
as they did with "Virtual Storage" on their mainframes. They may 
not come right out and say so. but the people who buy computers 
from them will look around after the fact and say, "Look at all those 
other computer companies imitating IBM. Aren't we great for 
buying our machines from the company that paved the way?" 

Apple has already gone even farther. A sign on their booth at a trade 
show recently proclaimed the Mac II to be "The first in a new 
generation of mullilasking home computers". Ask any Mac II owner 
and he will tell you that the Mac II has multitasking capability. What 
he won't tell you is his definition of the buzzwords. With the current 
software on the Mac II, one can indeed multitask, but only if the 
program that is currently running specifically relinquishes control 
to the supervisory scheduling program, or if the user manually 
causes a context switch to anotfier, waiting application. 

Let's take a look at a machine that really does multitask, one that 
has been doing so for two years now. Of course 1 am referring to the 
Amiga. The Amiga is not the first multitasking home computer, but it 
does have one distinction from previous multitasking systems such 
as the CoCo with the OS/9 operating system. That distinction is ail 
important, and is the fact that programs need not be specially 
written to use multitasking. This means that a program, unless 
written to inhibit multitasking, will get along fine with other pro- 
grams running concurrently, 



1 have heard multitasking referred to as a ''gimmick", as "useless", 
and worse. 1 have heard statements to the effect that "I can only do 
one thing at a time anyway", or '1 would never use it". One of the 
nicest things I can say about multitasking is that I hardly ever notice 
it any more, 1 don't think of it as a 'feature" - multitasking has 
t>ecome an ordinary, everyday activity for me, and 1 only appreciate 
it properly when 1 am faced with the unpleasant prospect of using a 
single-tasking machine. . - . . ; * ' 

With multitasking, you need not sit and wait while a compile or 
downloadishappening, or worry about whether you loaded up that 
favourite "resident utility". Your favourite resident utilities are there. 
All the time. All of them. Even your not-so-favourite ones are 
there, ready to be called upon. Need to look up a name and address? 
Uh oh. . , the compiler is running! No problem, just push the 
compiler window into the background and do a directory, load up 
an editor, a phone book, and address book, or in fact anything you 
want. The only limitation is the amount of memory you have. 

But won't everything run slower? 

Tm very glad you asked that question, because it is one that can be 
answered with an example. You don't get anything for nothing. 
There's no such thing as a free lurKh. We all know that, so where's 
the catch? The answer is that there is no catch. You do get 
something for nothing. What you get is better utilization of the 

available machine cycles. You get to use the resources you paid for 

when you bought your machine. Consider the following reasonably 
typical scenario. We will look at it on two different machines, one 
being the Amiga, and another being a mythical single- tasking 
machine that just happens to run the same programs and at the 
same speed, ' 

First the single-lasker. We will consider three programs: a terminal 
pr<^ram. an editor, and a ''CPU bound" program, say something 
like a Mandelbrot picture generator. With the terminal program we 
are going to download a file that will take about an hour at 300 
baud. With the editor we are going to write the all time best novel/ 
computer game/ whatever, and will spend an hour editing. The 
Mandelbrot generator will do the picture we want in an hour (you 
are papering your computer room walls with "brots aren't you?). 
The fact that the times are all one hour is an incredible coincidence, 
but will serve our purposes. 

On the single- tasking machine, we load up our terminal program, 
call the network or BBS, start the download, and go have lunch. 
When it is done, we can call up the editor and spend an hour 
writing. Finally, we start the Mandelbrot generator and wait again. 
Total time for these activities is three hours, not counting any time 
we spent setting up each program. Three hours, in which we spent 
exactly one hour interacting with the computer, and two hours 
waiting for it to finish. 



+ L_ 



On the Amiga, things are far better. First, we start the Mandelbrot 
generator, setting it to a priority of -2. Don't worry too 
much if ""2" doesn't mean much to you yet. It's a magic 
number that tells the Amiga something about your wishes. 




The Tronsoctor 



72 



January 198B: Vblume 8, Issue 04 



A little more on it later. Now, the good part starts. Right away, the 
first reaction of a new Amiga owner is to sit and wait for it to finish. 
Not so for the veteran! The veteran immediately starts up the 
terminal program, setting it to a priority of (another magic 
number, the Amiga is full of them). The BBS or network is called, 
and the download started. Pushing the terminal program back out 
of the way, we finally call the editor, at a priority of -1 , and star! on 
that prc^ram or manuscript. 

By now you've probably guessed that the Amiga is going to be busy 
for less than the three hours required by the other machine, and of 
course you're right. What happens is this: the three magic numbers 
tell the Amiga that the terminal program (priority 0) has priority 
over the other two programs, and that the editor has priority over 
the Mandelbrot program. The Mandelbrot program can say any- 
thing it wants to the potted plant on the desk. 

The result of this priority scheme is that whenever the terminal 
prf^ram needs to gel and process characters from the keyboard or 
serial port, it will be allowed to do so, usually immediately, and at 
worst, within a few milliseconds. Likewise the editor program will 
only be active when it has to service the keyboard or perform a 
command but, in addition, it will only be active when the terminal 
program is not actually processing data. Since characters are com- 
ing in slowly relative to (he speed of the CPU, even at 1200 baud, 
the editor gets a lot of time to do its thing. Similarly, when the editor 
is not busy processing, and the terminal is not busy, the Mandelbrot 
program can churn out some more of its picture. The Mandelbrot 
program is loo busy lo allow the potted plant any time at all. 

The bottom line is that the terminal prc^ram runs very nearly at full 

speed. It will be fini^ed its download in about an hour. While it was 
happening, you were writing, and noticed no slowdown in the 
response of your editor, so for all intents and purposes, you got just 
as much done in the hour as you would have otherwise. Hmm. . . 
pretty good so far We have done two'hours' worth of computing in 
just one hour. But what about the poor Mandelbrot program? Did it 
get anything done? Of course it did! Neither downloading and 
editing are very CPU intensive, and the Mandelbrot program got a 
lot of cycles- Granted, it did not get an hour's worth of cycles, but it 
got a lot. In practical terms, the Mandelbrot program will be about 
half or three quarters of the way through, and will run for another 
fifteen minutes to half an hour. It will run longer if you are a fast 
typist, using more CPU cycles to service the keyboard input, and 
shorter if you type like I do. 

So, in somewhat under 1 .5 hours, we have done three hours' worth 
of work, rd say that's a pretty good benefit, and when you consider 
that even while doing all this, we were not prevented from calling 
up some other job, or from looking at another file, listing disk 
contents, performing calculations etc., it becomes something 1. at 
least, am not willing to do without on a home computer. I think it's 
called "being spoiled". 



i 



In case 1 sounded a bit upset back there when talking about IBM and 
Apple, let me say now that i am glad they are finally seeing the light. 
Their multitasking, when it arrives, will effectively "legitimize" the 
feature, and we Amiga owners can all sit back with very smug 
expressions indeed. Of course, being polite, we will not laugh 
uproariously when next year some IBM owner tells us how great it is 
to be able to run four programs at once. Will we? 



New! Improved! 



^ ^ j^ 



TRANSBASIC 2! 



with SYMASS'^' 



< - 



■ ,' =1 



■ \ 



[.' 








'* •' 




' '. * 



I - 






( - 



'*' I 



■■.'■^i *, . h 






"I used to be so ashamed of my dull, messy code, but 
no matter what I tried I just couldn't get rid of those 
stubborn spaghetti stains!" writes Mrs, Jenny R. of 
Richmond Hill, Ontario. "Then the Transactor people 
asked me to try new TransBASIC 2, with Symass^, 
They explained how TransBASIC 2, with its scores of 
tiny 'tokens', would get my code looking clean, fast! 

"I was sceptical, but I figured there was no harm in 
giving it a try. Well, all it took was one load and I was 
convinced! TransBASIC 2 went to work and got my 
code looking clean as new in seconds! Now Tm telling 
all my friends to try TransBASIC 2 in their machines!" 



i*-i 



TransBASIC 2. with Symass, the symbolic assembler 
Package contains ail 12 sets of TransBASIC modules 
from the magazine, plus full documentation. Make your 
BASIC programs run faster and better with over 140 
added statement and function keywords. 

Disk and Manual $17.95 US, $19.95 Cdn. 

(see order card at center and News BRK for more info) 

TransBASIC 2 

"Cleaner code, load after load!" 



1j_ 






Ttie Transactor 



73 



January 196B: V6lume 8, Issue 04 



h^ 



A^ 



ACCESS 

The best of non-commercial software 

by Steve Ahlstrom, Denver, Colorado ,„ . 



■'^I 



w^^/- 



-ii 



i 



This new regular column is a nalurat for Steve Ahlstrom - he's the primary 
sysop on CompuServe 's AmigaForum, which, by the way, gets a tot of traffic by 
avid Amiga users and programmers. However, AmigaForum won 't be Steve 's 
only source and you can bet he 'It report any item worth knowing about. So if 
you have some information you'd lif^e to share, you can leave a message to 
[76703.2006] on AmigaForum, or send it to us and well pass it along to Steve. 



In the world of freely distributable software for the Amiga, there 
are many gems to be found. There is also a lot of broken glass. 
This column is meant to help you find the more useful and 
worthwhile of these programs. 

First of all, 1 guess ! should try to define just what "freely 
distributable" means. There are generally 3 classes of ''freely 
distributable" software. 

Public Domain 

"Public Domain", on the surface, seems to be the easiest to 
describe. In reality, it's probably the hardest (at least as far as US 
copyright law goes). 

To the non-legal type, ^'Public Domain" means that the author of 
the work (in our case, the author of an Amiga program) has 
given up all rights to the work and has placed his/her work into 
the "Public Domain'' for all to use, enjoy, change, sell, or 
whoever the case may be. The intent is that the author claims 
no rights at all on the work. Under US copyright law, though, it's 
a little less clear-cut than that. The law does not specifically say 
that something can be placed into the 'Tublic Domain" other 
than a work which has gone beyond the time frame granted for 
copyrights. There are many rules about how authors may 
reclaim their rights (within a specific time period) if for some 
reason they feel that they have lost control of those rights. If 
someone can place a program into the "Public Domain" then 
later re-establish control of the rights they explicitly gave up 
earlier, was it indeed "Public Domain" to begin with? See the 
possible problems? 

When it is stated that a program is "Public Domain", the intent of 
the author usually is that the program may be freely distributed 
and the author has no intention of reclaiming rights or limiting 
distribution in any way. 



-^li 



Shareware 

"Shareware'' is a little more clear cut. It's merely a non- 
conventional method of marketing a program. In some cases, it 



. n 



T..I 



".! 



-. y 



■ ^r- 



:?'^ fj^jT 



1 , 



works well, but in the vast majority of cases it is not very 
effectual. ^ '' 



.J T 



^ -■:*--" 



With ^^Shareware", the author is retaining all of the rights to the 
work and is allowing distribution of the work via .electronic 
networks, BBSs, user groups and so on. Somewhere in the 
documentation for the program you'll find a statement of the 
author's stipulations for distribution. Normally it says something 
to this effect: "if you like this program and find it useful, send me 
$xx.xx. If you do not, feel free to distribute this further, but 
please do not continue to use it if you have not paid for it," If you 
do send the author money, you will usually be put on a maiiing 
list to inform you of newer versions of the program and how to 
get them. Sometimes you'll be sent, upon payment, the latest 
version and the printed documentation. Read the stipulations 
carefully because each program is a little different. 



1. 



ji:" 



"Shareware" is a good concept, but like many good concepts, it 
has many abuses. It came about for a variety of reasons. The 
foremost reason is that someone thought of a need for a program 
but. because the program didn't have mass market appeal, no 
mainline software publisher would pick it up. By making it 
"Shareware" the author can get some money for the time and 
effort spent creating the program. "Shareware" usually fills a 
void between "Public Domain" and commercial software in 
quality. Unfortunately, many people are now putting the "Share- 
ware" label on everything they write. The problem becomes 
that everyone is asking for money. Many people have decided 
that since they don't have to buy the program in a store there is 
no need to send in the money for it (even if they find the program 
useful and often used) because everyone seems to be asking for 
money. This is a decisioEi only you can make. By not monetarily 
supporting those "Shareware" programs you find useful, you 
are discouraging the "Shareware" author from using this 
method of marketing for other works. Many "Shareware" pro- 
grams really deserve support. ■ ' 



«k 



Other 



L^>"-V, <^- ,,ri _f^ .!►■! 



^■- V ^ ^ ; 



-uj... 



!■ 



.'t 



The 3rd class is really just a subclass of "Shareware". It's a 
program that is copyrighted but for which the author asks no 



The Transactor 



74 



January 1968: Volume 8, Issue 04 



_LJ_liUi-^ 



UIM. 



compensation. The author retains the rights to the program, 
often because he wants to leave his options open legally to stop 
someone else from selling his work for a profit when his original 
intent was for the program to be free. 

r 

,, I- . J^,, 

SelPri: Adjust the priority of active tasks ■ 



L.^ I ■ r 



■^1-H, 



- J 



V'^' 



SefPri by Ben Blish is a fine example of a needed program that 
has little commercial marketability. To quote Ben's documenta- 
tion for SetPri: 



' ' ^ 



"SelPri is A^Or Shareware; far be it from me to presume 
upon you. If you really like the program, just tell me so by 
mail or on CompuServe. If you have suggestions, you can 
give Jhose also. . . if you want to complain, call Commo- 
dore. ! don't want to hear it! <grin>/' . 

L I 

\ 

SelPri allows you to set or change the priority of any task 
currently active in the system. When SetPri is run. it brings up a 
small window showing all of your current tasks. If you have 
more than eight tasks active, you can scroli through the list with 
the proportional slider. Just click on the task name {program 
name) you wish to change and set the new task priority, either 
higher or lower. 

There are many times (like now) that I may have my Amiga 
doing many things at once. Right now, \'n\ compiling a program, 
downloading a program from the AmigaPorum on CompuServe, 
and typing this column. Since the compiler is doing frequent 
disk accesses, and the priority is (normally) set higher than 
either my term program or text editor, I was finding that I would 
have characters 'dropped' when typing. So, I ran SetPri {which 
has found a permanent home in my c: directory). I bumped up 
the priority of my term program from to 5 and of my editor 
from to 2. 

With terminal programs and text editors, very little CPU time is 
used. Only when you are actually typing do the programs need 
to tun- In CPU time, there is a huge amount of time for the 
system lo use between keystrokes (even if you are 150 WPM 
typist!) Since Tm running the compiler in the background, it is 
running marginally slower than it would if it were the only task 
running but, because of resetting the tasks" priority levels, the 
compiler isn^l interfering with either my term program or text 
editor To me. controllable multitasking is the best thing the 
Amiga has going for it, and SelPri makes it easy to obtain that 
control. 

Next Issue 

There are dozens of freely distributable programs that can make 
life a lot easier for you. Im sure you know about many of them, 
especially if you frequent the commercial networks and local 
BBSs. Some of them may have slipped past your notice. There 
are many freely distributable games, terminal programs, lan- 
guages, text editors, spell checkers - almost anything you can 
imagine. Til be telling you about many of them in future editions 
of this column. If there is something specific you'd like to see 
covered, just let me know! 



_ ^. 



Bits & Pieces I: 



Th 





^ ?' ■ ^^'■■■ 




From the famous book of the sanne name. Transactor 
Productions now brings you Bits S Pieces I: The Disk! 
You'll thrill to the special effects of the screen 
dazzlers! You'll laugh at the hours of typing time 
you'll savel You'll be Inspired as you boldly go 
where no bits have gone beforel 



"Extfsofdinariiy faithful to the plot 
of the book. . . The BAM alone Is 
worth the price of admission!" 

r . , Vincent Can byte 



'Absolutely 
magnetlcir 

GeneSyscall 



"If you mount only one bits disk in 1 987, make it this 
onei The fully cross-referenced index is unforgettable! 

Recs Read. New/ York TIS 



WARNING Sojnf- '^ecrors cont^irf 



hvtes. Rated GCf? 



BJTS & PIECES I: THE DISK, A MyJar Film, rn awociailon wth Transacror Productions. 

Playing a: a drive r>ear youl 

Disk SS,95US. S9,95Cdn. Book SI 4.95 US. SI7.95Cdn, 
Book & Drsk Combo Just S 1 9.95 US, S24.95 Cdnl 






The Transoctor 



75 



January 1988; Volume 6, Issue 04 



News BRK 



L-k 



r:rtpW 



Submitting NEWS BRK PreM Releases 

r 

If you have a press release you would like To submit for the NEWS BRK column, 
make sure that the computer or device for which the product is intended is 
pn^minently noted. We receive hundreds of press releases for each issue, and 
ones whose intended readership is not dear must unfortunately go straight to the 
Irash bin, ll should also be mentioned here that we only print produci releases 
which are in some way applicable to Commodore equipment. News of events 
such as computer shows should be received at least 6 months in advance. 

Transactor News 



■:_ 



Transactor for the Amiga 

In case you haven't heanl, Ihe premiere issue of Transactor for the Amiga will be 
released Ihis January. The following few items describe some exlra special offers 
Ihat you shouldn't miss -most expire January 1st, 1988, 

Half Price lintil January Isl! 

fn case thai looks like a lypo^ here it is repealed. Subscriptions lo Transactor for 
the Amiga will be HALF PRICE until January I st, 1988. Send just $7,50 US or 
$9,50 Cdn for a full year of Transactor for Amiga programmers! 

Disk subsLription prices are even more incredible! Until January 1st, 1988, a 
Transactor for the Amiga disk subscription will f>e just $29.95 US or $36.95 Cdn! 
That's nearly half off Ihe regular price! You1l get a disk with every magazine 
conlaining all the programs we publish for the Amiga, and we'll probably add 
extra programs that aren't published too. 

Afler January 1 si, 1988, regular subscription prices for Tra/zsac/or /or /Vi4mga 
will be in effect. Magazine subscription prices are the same as for the original 
Transactor- $15 US and $19 Canadian. Disk subscriptions for Ihe new mag will 
be a little more until the price of 3V2 inch disks comes down - $55.00 US and 
$67.00 Cdn. 



I Want To Switch! 

With the Transactor for the Amiga coming this January many of our readers will 
wani to switch to the new mag for the higher concenlration of Amiga maierial 
Naturally there will be others that won't, and still others that will want both 
magazines. 

To switch to the new magazine, there's no charge. Simply put your name and 
subscription number on our postage paid cand and check off Ihe appropriate box. 
Please don't omit your name as this gives us a cross-reference to ensure we 
change Ihe correct subscriber record. 

Remember, there's one more Transactor coming out before the first issue of 
Transactor for the Amiga. Asusuai, it will also contain Amiga malerlal. Bui if this 
issue marks your last one^ you'll not only need to switch, you'll need lo renew as 
welL 

I Want BothI 

For those who want both magazines, we highly recommend you take advantage 
of the pre-release subscription pricing for tfie new Amiga publication, Afler 
January 1st, well be offering special combination subscription pricing, but it 
won't match the nice pre-release deals we're offering now. Details lo be 
announced nexl issue, 

I ' 

5ubscriptioD Renewals and Enquiries 

We gel a lot of calls at the office. One common reason is to enquire about 
merchandise that has not been received. So before calling about a subscription 
order or other purchase, please Iry to follow these guidelines: 

• First of all, make sure you contact the right people; if you receive Transactor 
with the special TPUG insert, you should call TPUG, not Transactor Publish- 
ing. If you renew a subscription with Transactor, you will receive the magazine 
without the insert, and your TPUG membership will not be renewed. 



3 






■'■H'lr; 'l''£l li "l\- .. 



• Second, note the expiry date of your subscription; the Volume and Issue 
number of your last issue is shown on the first line of your mailing label, 

• [f you're a subscriber, have your subscription number ready - it's the fastest 
was for us to check. 



Mail Order Products; 



J.J 



U.'V 



-1 



' J 



-_^r 



I 4 - I4- 



■ii 



• Clearly print your full name, mailing address, phone number, and a Compu- 
Serve account number if you have one. Confirming an address or potential 
error is accomplished mush faster over the phone, voice or data. 

• For renewals, include your subscription number AND at least one other piece 
of identifiable information such as your name. This allows us to ensure we 
extend the right persons subscription. For new subscriptions, please include 
your address. Believe it or not, we've actually received orders for subscriptions 
and other products with no address - not only are we unable to comply, but we 
can't even send back the uncancelled cheque! 

• Ontario residents; remember to add 7% provincial sales tax. The reply card 
clearly shows which items are taxable. . > - , . , ■ 

• Make sure payment is enclosed or credit card number is included, or we will 
not be able lo fill the order, If paying by credit card, clearly print ALL the 
numbers of Ihe card, and include the expiry date, ^ . 

• Do not slaple or glue subscription cards; cards sealed in this way can get 
destroyed when opened, causing great problems in filling the order It's best lo 
use tape around the three open edges. 1 ;. ■ > 1 

The 20/20 Deal 

. , js Still in effect - order 20 subscriptions to the mag or disk, 20 back issues, 20 
disks, etc., and gel a 20% discount. However, this offer cannot be combined with 
other specials, or to TPUG subscriptions and prt)ducts. 



(- 



Transactor Special Offer 



^'1- 



.^-■ 



The special offer this issue is for Transactor Back Issues. Order any back issue at 
the regular price of S4-50 (US/C), and get addiliona) back issues for only S2.00 
each! Order 10 total and the effective price percopy is cut by half! (S4„50 + 9 x 
J2.00 = $22.50| Once again, this special offer is in effect for this issue only so it 
applies only to orders postmarked before January 1 , 1988- ■ , , ■ 

Transactor Mail Order 

The following details are for products listed on the mail order card. If you have a 
particular question about an item that isn^t answered here, please write or call. 
We'll get back to you and most likely incorporate the answer into future editions 
of these descriptions so that others might benefit from your enquiry. 

■ f^oving Pictures - the C-64 Animation System, $29.95 (US/C) 

This package is a fast, smooth, full-screen animator for the Commodore 64, 
written by AHA! (Acme Heuristic Applications!), With Moving Pictures you use 
your favourite graphics tool to draw Ihe frames of your movie, then show it at full 
animation speed with a single command. Movie 'scripts' written in BASIC can 
use the Moving Pictures command set to provide complete control of animated 
creations. BASIC is still available for editing scripts or executing programs even 
while a movie is being displayed. Animation sequences can easily be added to 
BASIC programs. Moving Pictures features include: split screen operation - part 
graphics, part text - even while a movie is running; repeat, stop at any frame, 
change position and colours, vary display speed, etc; hold several movies in 
memory and switch instantly from one movie to another; instant, on-line help 
availableat the touch of a k^; no copy protection used on disk. - 

■ The Potpourri Disk. $17.95 US, $19,95 Cdn. '' 
This is a C-64 pn^duct from the software company called AHA!, otherwise 
known as Nick Sullivan and Chris Zamara. The Potpourri disk is a wide 
assortment of 18 programs ranging from games to educational programs to 
utilities. All prt^rams can be accessed from a main menu or loaded separately. 
No copy protection is used on the disk, so you can copy the programs you want 
to your otherdisks for easy access. Built-in help is available from any program at 
any lime wiih the touch of a key so you never need to pick up a manual or exit a 



The Transactor 



74 



January 19B8: Volume 8, Issue 04 



program to learn how lo use il. Many of the programs on Ihe disk are of a fiigh 
enough quality thai Ihey could be released on !heir own, bul you get all 18 on Ihe 
Potpourri disk for just $17.95 US/ $19.95 Canadian. See Ihe Ad in Ihis issue for 

more information. 

r ■ I ■ ' 

■ TransBASIC 11 tl7.95 US, $19.95 Cdn. 

An updated TransBASIC disk is now available, containing all TB modules ever 
printed. The first TransBASIC disk was released just as we published TransBASIC 
Column "9 so the modules from columns 10, 1 1 and 12 did not exist. The new 
manual contains everything in the original, plus all the docs for the extras. There 
are over 140 commands at your disposal. You pick the ones you want to use, and 
in any combinalion! It's so simple that a summary ol instructions fits right on ihe 
disk label. The manual describes each of the commands, plus how to write your 
own commands. 



¥*Lr ■_ ^ 



People who ordered TB I can upgrade lo TB 11 lor Ihe price of a regular Transactor 
Disk (8,95/9.95). If yon are upgrading, you don't necessarily need to send us 
your old TB disk; if you oniered it from us, we will have your name on file and 
will send you TB II for Ihe upgrade price. Please indicate on the order form thai 
you have Ihe original TB and wani it upgraded. ^ ' ' ■ 

fc^ I, _ 

Some TBs were sold at shows, etc, and they won*l be recorded in our database. If 
Ihat's the case, jusi send us anything you feel is proof enough (e.g. pholocopy 
yourreceipl, your manual cover, or even Ihe diskette), and TB II is yours for the 

upgrade price. 

m The Amiga Disk. $12.95 US, $14.95 Cdn. 

Finally, the first Transactor Amiga disk is available. It contains all of The Amiga 
prc^rams presented in the magazine, of course, including source code and 
documentation. You will fmd Ihe popular "PopColours" prc^ram, the program- 
mer's companion "Structure Browser", Ihe Guru-killing "TrapSnapper", user- 
friendly "PopToFront", and olhers. In addition, we have included public domain 
programs - again, wilh documentation - that we thmk Transactor readers will 
find useful. Among these are the indispensable ARC; Csh, a powerful CU- 
replacement DOS shell; BLink. a linker that is much faster and has more features 
than Ihe standard ALink; Foxy and Lynx, a 6502 cross assembler and linker that 
makes its debut on the Amiga Disk; and an excellent shareware text editor called 
UEdiL In addition, we have included our own expression-e valuator calculator 
that uses variables and works in any number base. All programs contain source 
code and documentation; all can be run from the CU, and some from Work- 
bench, There's something for everyone on Ihe Transactor Amiga disk. 

■ Transactor T-Shirts. $13,95 US, S15.95 Cdn. 

■ JumboT-Shirt. $17.95 US. $19-95 Cdn. 

As mentioned earlier, they come in Small, Medium, Large, Extra Lai^e, and 
Jumbo. The Jumbo makes a good night-shirt /beach-top - it's BIG, I'm 6 fool tall, 
and weigh in at a slim 150 pounds - Ihe Small fits me light, but that's how I like 
them. If you don't, we suggest you order ihem ! size over what you usually buy. 

One of the free gift choices we offer when you order a combination magazine 
AND disk subscription is a Transactor T-Shirt in the size and colour of your 
choice (sorry, Jumbo excluded). The shirts come in red or light blue with a 3- 
colour screen on the front fealuring our mascol. Duke, in a snappy white tux and 
top hat, standing behind our logo in 3D letters, 

■ Inner ^ace Anthology $14.95 US, tl7.95 Cdn. 

This is our ever popular Complele Commodore Inner Space Anthology. Even 
after two years, we still gel inquiries about its contents. Briefly, The Anihology is 
a reference book - it has no "reading" malerial (ie. "paragraphs"]. In 122 
compaci pages, there are memory maps for 5 CBM computers. 3 Disk Drives, 
and maps of COMAL; summaries of BASIC commands, Assembler and MLM 
commands, and Wordprocessor and Spreadsheel commands. Machine Lan- 
guage codes and modes are summarized, as well as entry poinis to ROM 
routines. There are seclions on Music, Graphics, Network and BBS phone 
numbers, Computer Clubs, Handware, unit-to-unil conversions, plus much 
more, , .about 2.5 million characters total! - - . ■. 



^ , 



■ The Transactor Book of Bits and Pieces 'I, $14.95 US. $17.95 Cdn, 
Not counling the Table ol Contents, the Index, and tille pages, it's 246 pages of 
Bits and Pieces from issues of Transacior, Volumes 4 thnDugh 6. Even if you have 
all those issues, it makes a handy reference - no more flipping through 
magazines for that one bil that you just know is somewhere. . . Also, each item is 



forward /reverse referenced. Occasionally the items in the Bits column appeared 
as updates to previous bits. Bits thai were similar in nature are also cross- 
referenced. And the index makes il even easier to find those quick facts that 
eliminate a lot of wheel re-inventing. 

■ The Bits and Pieces Disk, S8-95 US, 9.95 Cdn. 

■ Bits Book AND Disk, $19.95 US, 24.95 Cdn. 

This disk contains all of the programs from Ihe Transactor book of Bits and 
Pieces(the "bits book"), which in turn come from Ihe "Bits and Pieces " seclion of 
past issues of the magazine. The "bits disk" can save you a lot of typing, and in 
conjunclion with the bits book and its comprehensive index can yield a qukk 
solution to many a prc^ramming problem, . , 



.^1. 



^T 



III 



m The G-LINK Interface, S59.95 US, 69.95 Cdn. 

The Glink is a Commodore 64 lo IEEE interface. It allows the 64 lo use iEEE 
peripherals such as the 4040, 8050, 9090, 9060, 2031, and SFD-1001 disk 
drives, or any IEEE printer, modem, or even some Hewlett-Packard and 
Tektronics equipment like oscilloscopes and spectrum analyzers. The beauty of 
the Glink is its "transparency" to the C64 operaling system. Some IEEE 
interfaces for Ihe 64 add BASiC 4.0 commands and other things to Ihe system 
thai sometimes inlerfere with utilities you might like to install. The Glink adds 
nothing! In fact il s so transpareni that a switch is used to loi^le belween serial 
and IEEE modes, not a linked-in command like some of Ihe others. Switching 
from one bus to the other is also possible with a small software routine as 
described in the documentation. 



.1 ", 



As of Transactor Disk "19, a modified version of Jim Bulterfield's "COPY-ALL" 
will be on every disk. Il allows file copying from serial lo IEEE drives, or vk:e 
versa, ,■,,-,. 



1 1- 



■ Tfie Tr@ns®ctor 1541 ROM Upgrades, $59.95 US, $69.95 Cdn, 

You can burn your own using the ROM dump file on Transactor Disk "13, or you 

can get a set from us. There are 2 ROMs per set, and they fix not only the SAVE® 
bug, but a number of other bugs too (as described in PA. Slaymaker's arlicle, Vol 
7, Issue 02). Remember, if SAVE® is about to fail on you, then Scratch and Save 
may just clobber you too. This hasn't been proven 100%, but these ROMs will 
eliminate any possibilities short of deliberately causing them {ie. allocating or 

opening direcl access buffers before the Save), 

NOTE: Our ROM upgrade kil does NOT fit in Ihe 1 541 C drives. Where we supply 
two ROMs, Commodore now has it down to one MASSIVE 16 Kbyte ROM. We 
don'l know if the new drives slill contain the bugs eliminaled by our kil, but we'll 
find oul and re-cul a second kil if necessary, in the meantime, i541C owners 
should not order Ihis item until further notice, ■ " ' 

■ The Micro Sleuth; C64/1541 Test Cartridge, $99.95 US. $129.95 Cdn. . 
We never expected this cartridge, designed by Brian Sleele (a service lechnician 
for several schools in southern Ontario), would turn oul lo be so popular. The 
Micro Sleuth will lest the RAM of a C64 even if the machine is too sick to run a 
program! The cartridge lakes complete control of the machine. It lests ail RAM in 
one mode, all ROM in another mode, and puis up a menu with Ihe following 
choices; ■ 



I - 



1) Check drive speed 

2) Check drive alignment 

3) 1541 Serial lest 

4) C64 serial test 



5) Joystick port 1 test 

6) Joystick port 2 tesi 

7) Cassette port tesi 

8) User port lest 



A second board (included) plugs onto the User Port; it contains 8 LEDs that lei 
you zem in on Ihe faulty chip. Complete with manual. i - 

Transactor Disks, Transactor Back Issues, and Mkri^che 

All Transactors since Volume 4 Issue 01 are now available on microfkhe. 
According lo Computrex. our fiche manufacturer, the strips are the "popular 98 
page size", so they should be compatible wilh every fiche reader. Some issues are 
ONLY available on microfiche - these are marked "MF only". The other issues 
are available in both paper and fiche. Don'l check both boxes for these unless 
you want bolh the paper version AND the microfkhe slice for the same issue. 

To keep things simple, the price of Transactor Microfiche is the same as 
magazines, both for single copies and subscriptions, wilh one exception: a 
complele set of 24 (Volumes 4, 5, 6, and 7) will cost just $49.95 US, $59,95 Cdn. 



The Transactor 



77 



January 1969: Vblume 8, Issue 04 



This list also shows the "themes" of each issue. Theme issues didn't start until 
Volume 5, Issue 01. Transactor Disk *l contains ail prt^rams Irom Volume 4, 
and Disk "2 contains all pr(^rams from Volume 5, Issues 1-3. Afterwards there is 
a separate disk for each issue. Disk 8 from The Languages Issue contains 
COMAL 0.14, a soft-loaded, slightly scaled-down version of the COMAL 2,0 
cartridge. And Volume 6. Issue 05 lists the directories for Transactor Disks 1 to 9, 



■ VoL 

■ VoL 

■ VoL 

■ Vol, 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 

■ VoL 



4. Issue 01 
4. Issue 02 

4, Issue 03 

5, Issued 
5. Issue 02 
5. Issue 03 
5, Issue 04 
5, Issue 05 

5, Issue 06 

6, Issue 01 
6, Issue 02 
6, Issue 03 
6, Issue 04 
6, Issue 05 

6, Issue 06 

7, Issue 01 
7, Issue 02 
7, Issue 03 
7, Issue 04 
7, Issue 05 

7, Issue 06 

8, Issue 01 
8, Issue 02 
8. Issue 03 



( 



MF only 
MF only 
MF only 



(I 



* * 



■1 ^' 



Diskl) ■VoL4Jssue04- 

(■Diskl) ■ VoL 4. Issue 05- 

(■Diskl) ■ VoL 4. Issue 06 - 

-Sound and Graphics 

- Transition to Machine Language - MF only { 

- Piracy and Protection - MF only 

- Business & Education - MF only 

- Hardware & Peripherals 

- Aids & Utilities 
-More Aids 5[ Utilities 

- Networking & Com^munications 
-The Languages 
-Implementing The Sciences 

- Hardware & Software Interfacing 
-Real Life Applications 

- ROM / Kernel Routines 

- Games From The Inside Out 

- PT(^ramming The Chips 
-Gizmos and Gadgets 

- Languages II 

- Simulations and Modelling 

- Mathematics 
-Operating Systems 

- Feature: Surge Protector 



i Diskl) 
I Disk I) 
I Disk 1 ) 
I Disk 2) 
I Disk 2) 
I Disk 2) 
I Disk 3) 
I Disk 4) 
I Disk 5} 
I Disk 6} 
I Disk 7} 
I Disk 8) 
I Disk 9} 
Disk 10) 
Disk 11} 
Disk 12} 
Disk 13} 
Disk 14} 
Disk 15} 
Disk 16) 
Disk 17) 
Disk 18) 
Disk 19) 
Disk 20) 



Industry News 

World Of Connnodore Show 

_ + 

This year's World o\ Commodore Show promises to be as great as in previous 
years, and we'll be there as usiiaL Show organizers tell us that the original floor 
space allotment is 90% taken already and that more is being arranged. 

Unlike previous years, the official show hotel is now the Airport Skyline, It's a bit 
farther from the International Center, but the Skyline runs a regular shuttle bus 
service to and from the show - a nice change! 

Special show rales have been arranged - for more information contact Airport 
Skyline reservations al (416) 244-171 1. 

r 

New England 1987 Commodore-Specific Computer Fair 

MARCA New England is hosling this event on November 14 and 15, 1987 al 
Park West Hotel and Club, Marlbon^, MA. The Fair will include vendor exhibits of 
Commodore 64, 128 and Amiga products; seminars by nationally- known speak- 
ers on beginner users, telecommunications, languages, graphics, music and 
more; public domain software and resource tables featuring hundreds of disks of 
PD material for the Amiga and experts on hand to answer questions. General 
admission is S15 for 2 days with unlimited seminars; one day admission is $8 
without access to the seminars, S2 extra for seminar priviledges MARCA 
members should contact their user group for special rates, 

I I 4 ~ I 

Contacl: Frank Ordway, 6 Ragg Road Marlboro. MA 01 752, (61 7) 485-4677 

Also planned for the fair is "A Special Salute To Commodore" banquet on Friday, 
November 13. Al Duncan, President of Commodore, and Jim Btitlerfield, 
Commodore's most famous guru, will be the guests of honour Cost for the 
banquet is $18.95. Advance registration is required; make cheque payable to SF 
Pnxiuctions and send, along with name address and phone number, to: Sam 
Evangelous. 74 West Street, Clinton, MA 01510 • ^,' „■ ._. -^ 



i^L-^ 



Tbe 64 Emulator for Amiga . 

ReadySoft Inc, announces 'The 64 Emulator'* for the Amiga. Simply insert the 
Emulator disk into your Amiga and your Amiga becomes a Commodore 64. The 
64 Emulator has full support for all Amiga disk drives and printers, and with an 
optional interlace cable, any Commodore 64 disk drive can be connected 



directly to your Amiga through the parallel printer port, All video modes, 
including sprites and raster interrupts (used in most games), as well as sound and 
colour are fully supported. A monochrome option is included for additional 
speed when colour is not required. Written fully in 68000 machine code for 
maximum speed, The 64 Emulator lakes full advantage of the Amiga's hardware 
to give excellent 64 compatibility. Price is $39,95 US (149,95 Cdn.), S59.95 US 
($79.95 Cdn,) with interface cable. For further information contact: ReadySoft 
Inc, P.O. Box 1222, Lewiston, NY, 14092, (416)731-1472, 

CommodDre Creating Product List 

The following is from a letter from Peter Baczor, Commodore Customer relations 
manager, to manufacturers of products for Commodore machines: 

In an effort to better support our end-users I am creating a specification 
library of products auaHable for use with our computers, tfte 64-C. C-J28, 
Amiga 500, Amiga iOOO^Amiga 2000, and FC-W. "•'' 

I would be greatly appreciative if you would send me specification sbeels for 
the products currently amiiable that will operate with any of the abovemen- 
tioned machines. Please send this information to the foilowing address: 



I " 



1 1 II 



Commodore Business Machines i.'r. - ■ ^f,, ,..:: rx-ii 
Customer Relations, Dept. SU87 
1200 Wilson Drive 
West Chester. PA 19380 



Thank you^ 



1 1 _ - I 



,1 . ■ 



? ;. 



ji' ^-y.i 



'r--- r=J;r. '^ 



uV \'h: 



i'". 



New UEDIT Release 






--...!-i V'. 



1 ■ 1 



'^ ' "' Regards, 

PelerJBaczor 
'- "' Manager, Customer Relations 

Uedit V2.3 is now available, Uedit is aShareware text editor for the Amiga, noted 
for editing power (up to 1 00 files at once] and extreme versatility. It uses mouse 
cursor-placement and mouse-scrolling, function keys, menus, gadgets, and on- 
line help facility. All of these and virtually everything about Uedit can be 

customized while you are using it. Up to 1680 user-defined menu selections and 
hundreds of key, mouse, and gadget commands can be on-line, 

V2,3 expands Uedit from being a remarkable Amiga text editor to being a 
powerful and flexible word processor as well. V2,3 has a Teach Mode which 
teaches beginners what each input does and many new features, such as tab 
rulers, ^it-while-you-prinl, document/nondocument mode, and many more, 
Uedit can be configured (by an experienced user) to emulate popular word 
processors. It has most of the same capabilities they do plus far greater power, 
capacity, versatility, and ability to automate tedious editing chores, Uedit does 
not have a built-in spell-checker and doesn't show boldface and italics on the 
screen, but it works with any no n proportional font and with all known hardware 
and system modifications to your Amiga. ■ - ,,■ . --■,1. 

You can order Uedit from Rick Stiles, P,0. Box 666, Washington, IN 47501 . Uedk 
costs $45 (US) and purchasing it makes you a registered user. You receive a serial 
number, $15 commissions when others register from your serialized copy of 
Uedit. a Shareware diskette which you can freely distribute, a private diskette 
with full documentation on it, notification of upgrades, custom user-written 
configurations such as UStar (written by Kurt Wessels) which emulates Word- 
Star(tm)and Scribble!{tm), powerful directory utility and computer prc^ramming 
configurations, a number of utility programs, and a 30-day satisfaction guaran- 
tee. Uedit keeps improving because of good ideas from its hundreds of users. As 
a registered user you can subscribe to the Quarterly Newsletter, earn commis- 
sions for hnding new users, purchase upgrades at low cost, and contribute your 
custom configurations and good ideas to keep this program improving. 

r ■ ' n j_ ^r- ■*" J ' - ^ ^ _r ' ■ ^' 

ComspecHardDriveforthe Aroitfa 1000 r * 

4 1 I . 

Comspec communications has just announced the availability of their new high- 
performance hard drive for the Amiga. Features: 

Auto-booting: in auto-boot mode, Kickstart and Workbench are loaded from 
the bard disk immediately after powering up; no need to keep swapping disks, 
even after a Guru Meditation. No other hard disk for the Amiga has Ihis feature. 

Able lo handle media defects: Media defects are handled transparently to the 
user, unlike other hard drives that force you to reformat the disk. 



The Transactor 



76 



JanuQiY 1988: Volume 8, Issue 04 






NoRnVJEsr 



MUSIC 
CENTER 

INCa 



539 N. Wolf Rd., Wheeling IL 60090 
Hours • Phone (312) 520-2540 

Mon.-Thurs. 12:30-8:30, Sat. 9:00-4:00 



1 



We want to te Commodore sh 

"" * NWM cares!! We still siocr o ^^^ ^^^ ^^^.^^ programs. 

^ Pa.s a.a,-^aNe f or so.e 8000. m O an<^ B ser/es .ode>si 

a Kind • Surplus • MontWy Special • Closeouts g^^. 1 ^ %^. Ari :^M ^^f^'f^* wwww 



One 



8023 150cp3 IEEE S179 95 

4D23p lOOcps rehab S99 00 

P-i cable S24 95 

l-l cable S29 95 

Pel swUch , . S199.00 

Pet daughters Sl05,00 



Avafei" 1200 modem . , S94 95 

9090 7 5 meg rehab .......... $495 00 

e4K ram enp B033 S125O0 

Monochfome Monitor $79.95 

Smith Corona DM-200 $179.95 



NWM's 

INVENTORY CONTROL 
SYSTEM* 



■■m 





■■ «■■■«■■ 




■SB* 




■■« ■■■■ 
■■■ ■■■■ 
■H «■■■ 



R^quiF^ uM of 3Up4lt>dS& 




loads program modules in less ihan 8 icconds 
{auperbase 2} lo mam menus in 3 9«concfi or less 
on screen pop-up calculalof ^n IrEin^^clion 
modules 

Tio^t dala centerBd lunction us« Ihe calculator 

keypad 

ver^lile repOi't features allow lor 3 wayt to print 

Tho same report User selects Ihe faslesl method 

buJh Jn sophisucaied export program allows for 

ccmplele packing of the database 

type ahead leal u re allowed 

you can display feporjs on screen 

access f o syperbase menu lor user developed 

appNcaiions 

B Vaiiton 1 flOSO S49.95 

B Vvnion 2 aOSD 149.95 

C-12B Vftraion 1 1571 . M9.95 

B-128 Version 1A2 80S0 SM.W 



B-128 

$145a: 



NEW 12aK USER INSTALLABLE 
MEMORY EXPANSIONT 
INTnODUCTORY PRICE OF ONLY $125, 




SOFTWARE FOR THE 8-128!!! 

, CABS Accounting 



Superbase ................. $19-95 

Superscript ..,,,.,.,.. (1995 

Superof ice Integraled 

Superbase * Superscript ....... $49 95 

Calc Result Se9 95 

WordRwull ..' .' $89.95 

Super DisV Doc ............... 24.95 

The Power of Calc Result (Booli) %^A 95 



General Ledger ............ $ 9.95 

Accounts Receiyabfe ........ S 9.95 

Accounts Payable ,.,...,.... I 995 

Order Enlry I 9.95 

Payioi\ I 995 

Buy all 5 far only $24.95 

Superbase. The Book $14.95 

Applied Calc Result (Book) ...... 114 95 




only $27995 

white supplies last 



With Five 

Interpretive 

Languages: 

Cobol 

pjivcal 

Bade 

Forlran 

Apl 



Runs 8032 software. 
Great for sct^ools and students 

64K Memory Expansion for 8032 only $125 
upgrades your 8032 to an 8096. 



COMMODORE 
8000-9000 SOFTWARE & MiSC 



J \, 



' i ^ 



fiOOO Superpet $27995 

64K exp for 8032 V25 

Pel Switch $199 

Pet DaughlErs $105 

BPI G^eral Ledger $25 

BPI Accts Payabfe . , . , , , , , $25 

SPI Job Cost $25 

BPI Accts Receivable , , , , . $25 

SPI Invertorv -.-.-..,,., $25 



Superscript 6032 $73 

Superbase B096 $79 

OZZ Database $25 

Legal Time Ace , $25' 

Dow Jones Program ............ $25 

Jnto Oesigr5e032 . . 
Accounting System ,...,..,..,. $50 
Superotfice 8096 -..,.,....,... $149 

Care Result 8032 $69 




SFD1001 1 Megabyte 
DHve double sjded 8250 
format iEEE Jnterface 

PfttCED AT $169.95 US 



SFD-1001 ks the drlvethal you should cunsider when yog need largaamouniaoldaiaslorHge It holds 
otfor 1 rregabyle oi OaO on its smgla floppy drive Fasi hEEt access lor your C-S^ oi C-i?B. (C-&4arid 

C-1?6nee^dn IEEE iniarfaca ) Why settle lois^ohverdnvea hvlth le^ssEOfagflcapacHy Thisdrlvagtoru 
suDslantisHy mora programa and data Think ho* much money you can save on fJisl" DurchassH In 
lacl, it stot« almost 7 times more informahon Ih&n your stari^jaro dnwe Budalm hoard owners lova 
Iheni And whai an mlroduclorypncel At $169 95 mesa drives will seM fast, so don't «Hit ThisdrivehBS 
Iha Identical jormat of a CBM a^SO dnve, one o' Commodores mosi duiahle llQppy drives. 



MODEL 


SFD-1Q01 


Seclor/Cylinder 


^ 


DRIVES 


1 


Sec'or/Track 


23-29 


HEADS/DRIVE 


2 


Bylea/Seclor , ■ 


25€ 


STORAGE CAPACITY iPer Un 


III) 


Free Blocks 


,.4133 


Form sited 


1.06 Mb 


TFANJSFER RATES (Bytes/Sec) 


■ 


MAXIMUM (Each Drive) 




Internal 


40 Kb 


Sequential FMe 


105 Mb 


IEEE-4a8 Bua 


1.2 Kb 


Relative File 


1.04 Mb 


ACCESS TIME (Millf-secordB) 




Diatc System 


' . 1 


Track-to-lrack 




Buner RAM jBylea) 


4K 


Average track 


^ ** 


DISK FORMATS [Each Drive) 


' 


Average Latency 


100 


Cylinders [Tracks) 


J PI) 


Speed jRPM) 


- 300 



ORDER NOW WHILE STOCK LASTS! 

Send or call your orders to Norlhwesl Mus^c Cent^, inc, 5^ N Wair Rd . Wheeling lt_ 60090. 
312-530-2540 For prepaid orders fltlO lli.yu loi BU^Lip, 135 Superp&t. 9 95 SFD lOOt. ^U 95 B-l^d. J95 
4033p. 15 95 9Og0an0 4 95S4KrTiemorveKpan3Jcin For sDl[*areadd Sa.DOtorfir&t and 51 50 lor each 
additiDr>ai booh or program Canadian shipplnQcnargeaare double U S Inl^rnationa^ ord^FSn call for 
shippmy ForC O D ofderaadd I 90 per box snipped All orders musi ba paid inU S lunds Include 
phonenum&ers mlh area codes- Do not use PO Box, only UPS shippable addresses A 2 week hold 
will be impOAtdonail orders placed wilb a personal or business cbech CO D o^do^s abkppeain UrSr 
only andcaaJrondelivflry, no checks aOday wafranly on all products IrornNi/rfU, Inc NomanutSclurer 
warranty NWM reserves Ihenghl to limit qyahliries to stock on hand ^ndadjusl pncaswilhouf nolicel 

All price* quoie<l in US doll^r«. 



^r^^v^r^ 



Intelligent SCSI Ccmtroller: Allows for high-speed mullilasking. leaving Ihe 
Amiga free lo do other lasks while the drive seeks and retrieves data; other hard 
drives will not even allow you to enter keystrokes while these q)erations are 
occurring. The SCSI controller also allows lor maximum expand abi lily, allowing 
the user lo add additional hard drives, tape streamers, etc. The SCSI controller 
also contains a battery backed-up clock, which automatically sets the system 
lime on power-up. 

Hard Drive Chassis: Allows enough room to add hard drives from 1 to 300 
megabytes, or space lo add a second half-height hard drive or tape streamer. It 
comes with a power supply that is capable of running on voltages from 100 VAC 
to 240 VAC, at 50HZ or 60HZ without setting any switches or jumpers. The 
chassis is equipped with a low noise fan lo protect from overheating and provide 
greater feliability. , - .^^ 

The drive can he ordered with one or two 20 or 40 megabyte drives in the 
chassis; lai^er sizes are also available. 

For pricing and other information, contact: Comspec Communications Inc. . 153 
Bridgdond Ave, Unit 5. Toronto. Oni M6A 2Y6. Phone: (416) 785-3555 fax: 
(416)785-3668. ^ , 



^\ ^ -^ 



ROMDISK witb HYI^RBOOT for tbe C64 

Epimetheus Corporation has introduced its 128K-byte ROMDISK with HYPER- 
BOOT lor Ihe C64 and C128 in 64 mode. U combines all the hardware and 
software you need to create a library of up to ISOofyourfavouritepn^gramson 
an EPROM bank attached to the user port. Transferring program files from a 
1541 disk drive to the ROMDISK is made simple with a menu-driven program. 
This software, called HYPERBOOT, is provided on an 8K cartridge. Once 
programs are transferred from floppy disk lo the ROMDISK, they load at a rate of 
1 6,000 bytes per second. The ROMDiSK comes in a finished case with all 128K 
bytes of EPROM installed. It is erasable using ultraviolet light and can be re- 
programmed thousands of times. Also available are two-way switches that allow 
both a modem and the ROMDISK to occupy the user port (S39 US] and a 3-fool 
extension riblron cable lo allow remote placement of the ROMDISK or a modem 
($24.95 US), ROMDISK with HYPERBOOT sells for $179.00 (US). 

Contact: Epimetheus Corporation, P.O. Box 171, Clear Creek, Indiana 47426 
(812)336^508. 

MIDI Interface for C64/ 128 and 64C 

Audio Dii^ital Processing Systems is announcing the release of ^Dl 64, an 
intelligent MIDI interface for the C64/128 and 64C computers and all MIDI- 
equipped instrumenls and devices. 

MIDI 64 is the only all-Canadian MIDI interface, and introduces many innova- 
tions, such as a i 6K auto-boot bank-switched EPROM containing; an extensive 
MIDI supplement to BASIC for easy custom MIDI prt^ramming; a real-time 4- 
track sequencer; a MIDI-dala monitor for hex/binary/ decimal real-lime data 
display: an inlerface/cable aut<^test program. Ail prc^rams are automatically 
available on power-up, and can be switched out to run other software. 

The MIDI 64 package includes: MIDI interface with EPROM installed, two MIDI 
cables, lull docunKnIalion on disk, and MIDI BASIC program examplcs. 

With a su^esled Canadian retail price of $199.95. ADPS is targeting MIDI 64 al 
musicians, home hobbyists, students, repair technicians, and small recording 
studios. The package is especially well-suited for programming and MIDI 
teaching in the classroom, and first-time MIDI users. Dealer and distributor 
inquiries are invited. Contact: ADPS, c/o Phil Honsinger, 86 Foxhunt Road, 
Waterloo. Ontario, N2K 2Z6, (519) 886-6361. 

GEOS Upgrade for the CI 28 

Berkeley Softworks is offering GEOS for the C128 to registered C64 GEOS 
owners for just $22.00 (US) plus $2.40 shipping/handling. The 128 version of 
GEOS runs at 2 MHZ, supports 80-column mode, and uses Ihe optional 1750 
RAM expansion unit as a RAM-disk. Contact: Berkeley Softworks, 2 ISOShatluck 
Avenue, Berketey, California, 94704, (415) 644-0883. ' 

Video Digitizer for the C64 

Eye-Scan (n^ni Digital Engineering is a video digitizer for the Commodore 64, 
64C, SX64 and C 1 28. Eye-Scan's cartridge plugs into the user port, and accepts a 



composite video signal via a standard RCA jack. Conversion time is approxi- 
mately six seconds per gray level. Eye-Scan's software uses pulWown menus 
and allows black and white imaging, up lo eight gray levels, image inversion, and 
1525 printer support. Also included is a programmer's utility package that allows 
programmers to use the imaging capluring algorithms in their own programs. 
Possible applications include animation, security, automated process control, 
pattern analysis, robot vision, and text recognition. Contact: Digital Engineering 
and Design, 2718 S.W. Kelly Suite CI 65, Portland, Oregon, 97201, (503) 245- 



1503, 
C128CP/MKit 



':■ .'* 



•d 



.^t 



INCA announces the release of a CP/M kit for the Commodore 128. The kit 
consists of a SS-page booklet and two disks of CP/M public domain software 
which: explains the use of some of the programs on Commodore's system disk; 
demonstrates some of Ihe main features of Commodore's CP/M; shows tiow to 
get started using a modem lo obtain more CP/M programs and inlormation. 

The "CP/M kit for the Commodore 128" lists for $29.95 (US). Contact; INCA, 
1249 Downing St, P.O. Box 789. Imperial Beach, CA 92032. 

Aegl8 Releases **Art Paks" for the Amiga 

Aegis Development, Inc. has released "Art Pak, Volume r for the Amiga, 
consisting of art done by Aegis' pn^fessional art team. Volume 1 includes 
photograph -quality artwork of buildings for use as backdrops, pieces of eel 
animations for creating one's own walking, moving animations. Since Aegis 
Animator can do both melamorphic and eel animation, these images can be 
used with both styles as different ihin^. , i 

Art Paks can be used with Aegis Images professional paint program, Aegis 
Animator, and Aegis Draw, the entry-level CAD program for the Amiga. Any 
pn3gram that can read IFF format graphics files will be able to take advantage of 
these images. Art Paks will sell for $34,95 (US) at retail outlets for Amiga 
software- <' 

Genealogy Program for the 8032 

Byteware now has a version of "the Genealogist" for the PET 8032, following 
their versions for the 64, 128 and Plus/4, This program vastly eases the 
Genealogist's record keeping tasks, and is available in 4040 or 8050 formal. An 
Amiga version is under development. Send a SASE to Ihe following address for 
information, sample sheets, and prices for the various prctgrams (prices start al a 
very reasonable 19.95 US). Maple City Software, 906 WesI 6th Ave. Monmouth, 
11,61462. 

1 .1-- . - ■ »i 






^*^M 



8051 Cross Assembler for the C64 and C128 



.I,"':-- H 



The Zipp-Code-Sl is an assembler for the 8051 processor, used in smart 
peripherals, robotics and other applications. The editor used is the standard 
BASIC editor of the 64 or 128. There are Iwo versions of Zipp-Code-51, optimized 

for either the 64 or the 128. The package also includes a symbol cpdss reference 
utility, a disassembler, and a binary lo source file converter. Price is $49,95 
(Including shipping); specify C64 or C128 when ordering- Order from: Hughes 
Associates Software. 45341 Harmony Lane, Belleville, Ml, 48111, (313) 699- 
1931. . ' 

Ute-BRKing News: Oxxi Claims Benchmark M2 

This just in, as they say. t^l issue we ran a press release for the Benchmark 
Modula-2 development package. The source for the software was given as Oxxi 
Inc. of Fullerton, California, the company from whom we obtained Ihe pre- 
release copy briefly reviewed in this Transactor {see page 59). A few weeks back, 
we were informed by Leon Frenkei, author of Benchmark, that he had severed 
relations with Oxxi and would henceforth be marketing hts Modula-2 through 
his own newly-formed company, Avani-Garde Software. Accordingly, it is Avant- 
Garde's name (and pricing) that appears with the review. Just as we are about lo 
go to press, however, we have been told by John Houston of Oxxi that his 
company is disputing Frenkel's claim to have title to Benchmark. Well, we aren't 
lawyers, and we don't know which way this particular cookie will crumble. We 
can tell you that Benchmark is (at this instant) available from Avant-Oarde only, 
that the queslion of ownership will probably be resolved one way or another by 
the time we print our next issue, and that whatever happens Ihe product does 
exist and will be supported. By someone. 



The Transactor 



SO 



January 1988: Volume 6, Issue 04 



'A 






£/"> 



Type in a lot of Transactor programs? • 
Does the above time and appearance of the sky look familiar? 
Witli The Transactor Disk, any program is just a LOAD away! 

Only $8.95 US, $9.95 Cdn. Per Issue 

6 Disk Subscription (one year) 

Just $45.00 US, $55.00 Cdn. 

(see order form at center fold) 



ETmuSSm 




l^u^u^im^inn 



Transactor Amiga Disk #1, $12.95 US, $14.95 Cdn 

All the Ainijiii projjrams from the magazine, u ith complete 
ducumcntation on di:^k, plus our pick ot the public domain! 



THE WORLD 



OF 






t\ 




T + 



^t 






/ ^Bl 
■■■■■■■■■■■■■■■■■ft^^^M^^ ^1 


- 

IBBBBBBBBaSBBI 
■ ■■■■■■■■■■■■1 


■BB 
■ ■■ 


■■■■■■■■■■■■■■■■■■^^B ■■■■ 
■■■■■■■■■■■ ■■■■■■■■^-^■■■1 

■■■■■■■■■■■■■■■■■■■■■■■■■I 

• ■■■■■■■■■■■■■■■■■■■■■■■■■■ 

■■■■■■■■■■■■■■■■■■■■■■■■■■ 

■■■■■■■■■■■■■■■■■■■■■■■■■I 
■■■■■■■■■■■■■■■■■■■■■■■■■1 


■■■■■■■■■■■■■bbb 

!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 

■■■■■■■■■■■■■■■a 

!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 


■■■■■■■■■■■■■■■■■■■■■■■■fli 


!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 
IBaBBSHB ■■■■■■■■ 

■■■■■■■■■■■■■■■a 

!■■■■■■■■■■■■■■■ 

!■■■■■■■■■■■■■■■ 
■■■■■■■■■■■■■■■I 
!■■■■■■■■■■■■■■■ 


■■■■■■■■■■■■■■■■■■■■ ■■■■■■ 


!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 

■■■■■■■■■■■■■■■a 

!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 
!■■■■■■■■■■■■■■■ 

■■■■■■■■■■■■■■■a 

!■■■■■■■■■■■■■■■ 
■■■■■■BH ■■■■>■■■ 


■■■■■■■■■■■■■■■■■■■■■■■■■I 
■■■■■■■■■■■■■■■■■■■■■■■■■1 


!■■■■■■■■■■■■ 
!■■■■■■■■■■■■ 

ISSiSiMraP 






- f"* hone tof 


aest C 




u 



i 



• 1 



TPUE tas 



Volume 2, Number 1 



For TPUG inquiries, call (41 6) 733-2933 



President's Report 



TPUG is celebrating its 10th year as the oldest 
registered Commodore Computer Club, As a 10 yr 
old, it can look back upon the previous year, and 
chart its changes. 

TPUG has substanlialiy lowered the prices of its 
disks. 

As of July 1987. TPUG released its first summer 
disks of the month. 

To conform with the above, TPUG has altereti its 
disk of the month subscription to include both the 
lower disk prices, as well as the 12 months of disk 
releases, 

TPUG now has a disk catalogue for the most 
popular libraries, namely, C64, C128. CP/M, 
Amiga. The Amiga library, following the lead of the 
C64, the C128 and the CPM libraries, has grown 
significantly lai^er, and now includes original 
TPUG Amiga disks. 

TPUG is pleased to note that turn around lime for 
processing memberships and disk sales is now 
reduced to four days, thanks to the efficiency of our 
present office staff. There are now two part time as 
well as one full time office staff members, Judy 
Bella, Joy Bennett and Dorothy Hoellwarth, mak- 
ing concerted efforts to respond to your concerns 
in these two areas has reflected in an increase in 
profit from $6,000.00 in 1986 to $12,000.00 in 
1987. 

TPUG has been very active since April '87 on 
Quantum Link, maintaining our own area within 
the Commodore Information Network. Not only 
have we uploaded choice programs for the C64 and 
the ^28. but are also answering varied questions 
on all Commodore machines. Because of our ex- 
pertise on the PET and VIC 20 machines, we have 
been invited to expand our sphere of influence in 
the Network. We will soon have choice PKT and 
VIC 20 prc^rams uploaded to our online library. As 
of August, we also opened an active conference 
area online, so that not only TPUG members may 
join the TPUG conferences, but also non-TPUG 
users may come and look us over, so to speak, and 
to get acquainted. TPUG's online association has 
introduced the world's largest (and oldest) User 
Group to many of the newer users of this fine 
machine. 



TPUG partook in the three major computer shows 
in Tomnto this year, {World of Commodore, Com- 
puter Expo, and Computer Fest) This gave me, and 
the 'show team' the great opportunity to meet 
many of our members face to face, renew many old 
acquaintances, make new friends and welcome 
many new members, I enjoyed having the oppor- 
tunity to help raise public awareness of TPUG, and 
of its many services, and to show the publk: that 
Commodore Users are in the forefn)nl of computer 
happenings- 

TPUG is planning on expanding its role at the 
World of Commodore Show in December '87, to 
include being Group Host for all the User Groups in 
North America, if not the world. 

For the first time, we are acting hand in hand with 
Commodore of Canada. In early August, Commo- 
dore of Canada came to us to request help in their 
promotion of the Amiga. In exchange for the 
names and addresses of the TPUG Users' Group 
Representatives, Commodore installed a Canadian 
800 number (668-01 60). This is the number that 
dealers may use to contact TPUG, in order to issue 
'on the spot' memberships to future Amiga own- 
ers. This special Amiga deal (which is also availa- 
ble to registered current members) and the 800 
number, are to end Oct 31, 1987, 

This has been a year for financial recovery for 
TPUG. Planning, expertise and many long hours of 
volunteer work have paid off in a stabilization of 
the membership (approximately 6,000), and a 
sound bank balance. 

I would like to thank the many volunteers who, 
over the years, have helped make TPUG what it is 
today. Some of these people include: 

Our meeting co-ordinators: William Barrett, Cord 
Campbell, Donald Dalley, Mike Donegan, John 
Easton, Keith Falkner, Don Farrow, Allan Farqu- 
harson, Gerry Gold, Victor Cough, Jim Hamilton, 
Ian Mackintosh. Avy Moise, George Skinner. 

Our librarians Paul Atchison, David Bradley, Syd 
Bolton, Derik Campbell, Ernie Chorny, George 
Davis, Mike Donnegan, Bill Dutfield, John Easton, 
Victor Gough, Colin Justason, James Kokkinen, 
Jane Parris, Adam White, Ray Widden. 

Our BoanJ of Directors: Chris Bennett, David Brad- 
ley, Richard Bradley, George Davis. John Easton, 
Carl Epstein, Keith Falkner, Allan Farciuharson, 
Gerry Gold, Mike Donegan, Meyer Toole. 



Our BBS Operators: Sylvia Gallus and Steve 
Punter. 

Our Quantum Link SysOps: David Bradley (Dav- 
Bradley) and Jane Parris (JaneParris). 

And all other volunteers, especially George Shiri- 
nian and those I have come to affectionately call 
'my show team*. 

In closing, 1 thank you all for your support, help. 
and input throughout the past year ! wish you 
continued success and may fortune smile upon you 
in the years to come. 

Questions 

. . .Concerning TPUG or the TPUG insert, should be 
directed to the TPUG office, 5300 Yonge Street, 
Wilbwdale, Ont. MSN 5R2. or phone 416-733-2933 

Want to earn $50.00 easUy? 

Send TPUG a usable one page (1200 word) articie 
(or fraction thereof) on Commodore computing 
that you have written, and that we may publish in 
the insert, and TPUG will pay, in return, $50.00 
Canadian per page. Please submit to Transactor, 
dept TPUG, on disk, and indicate W/P used. Or 
you may choose instead, to receive a free years' 
subscription to TPUG instead! Your choice! 

Update on the 'Amiga Deal' 

After talking to some of the retailers in and around 
Toronto, it seems that about 50% of the people 
coming in the their stores to look at the Amiga, do 
buy it, swayed by the software package deal. In 
response to this local increase in Amiga owners, 
TPUG is opening a Central Amiga Chapter. For 
more information, see meeting schedules, else- 
where, 

Correflpondence from England 

A letter received from A, D. Miller, of Essex, 
England, leaves me with the distinct impression 
that Commodore PD software is in great demand 
over there, selling tor £4 -jCS per disc. Like you, 1 
was astounded to find out that the majority of C64 
owners there use the dataselte as their storage 
medium! 1 was aware that the PET, C16 and Plus4 
were alive and kicking there, but had no idea of 
their dearth of PD C64 software! 

Anne E, Gudz, President TPUG 1986-1987 



TPUG News 1 



World of Commodore 



The world's largest best attended Commodore 
Computer show is taking place Dec 3-6, at the 
internalionai Center. Airport Road, Toronto. 

There will be more than 120 exhibitors, 
occupying approximately 60,000 sq. ft. of floor 
space. This is the only show in North America 
that Commodore itself has a booth (3,000 sq. 
ft). Also included in the list of exhibitors (be- 
sides TPUG, of course) are: Desk Top Com- 
puters. Electronics 2001, Phase 4 Distributors, 
and Thornhiil computers, to name but a few. 
For a bargain hunter as myself, it was a virtual 
paradise! Each day of last year's show saw 
bigger, better and different bargains, and I 
expect the same of this year's show! 

Probably the best bai^ain, of course, is the 
TPUG Public Domain disks. Our enhre library 
will be available, at the special show price of 
$5.00 each (5'/2" floppies only)! If you have large 
orders, I suggest you call the TPUG office NOW 
and have them prepare your disks for you, then 
you do not have to wait in line for the show team 
to duplicate them! (Canadians can use the 800- 
668-0160 number until October 30!) 

You may also pick up. at the TPUG show 
booth, back issues of the TPUG magazine, at 
bai^ain rates, as well as information of where 
the bargains of the day are to be found! 

For overnight visitors. TPUG has arranged a 
special rate of $65.00 Canadian per night, {sin- 
gle or double), at the official WofC hotel: SKY- 
UNE TORONTO AIRPORT HOTEL, 655 Dixon 
Road, Toronto, Ontario, Canada, M9W 1J4. We 
have arranged for a mini-bus shuttle service 
from the hotel to the show, morning and eve- 
ning, for your convenience. As well, at the 
hotel, there will be a TPUG hospitality room, so 
that members, friends and users may congre- 
gate to swap stories, exchange information, 
find out what to see and do in Toronto. Don't be 
surprised to see such notable 'drop ins" as Jim 
Butterfield, Steve Punter, Sylvia Callus, Karl 
Hildon, Nick Sullivan, TPUG Board of Direc- 
tors, other User Group's representatives, and 
even Commodore representatives! I know that 
many of the QUNK SysOps, Qguides and up- 
ioaders will be at the show and are invited to 
the TPUG hospitality room. Here is your 
chance to meet, in person, so to speak! 

Call the Hotel directly when you book your 
reservation, and inform the desk that you are 
attending the World of Commodore Show. Oth- 
erwise, you will not receive the reduced rate. 
SKYLINE phones numbers; local 244-4296, 
Ontario loll free 1-800-268-1444, Canada/US 
toll free: 1-800 268-1332 

Regular Admission rates to the show are 



$6-00 adults, $4.00 students/seniors. However, 
if you have the $1,00 off coupon, that will be 
honoured, or, if you have forgotten to bring 
that, do bring your vaiid TPUG membership 
card, which will act as the coupon. TPUG is 
working closely with the promoters of the 
show, The Hunter Group, to offer a family 
entrance fee, as well as a multi-day pass. If you 
are interested, please enquire at the ticket 
booths. 

For those teachers and/ or senior citizens out 
there, busloads of 25 or more attending the 
show Dec 3 or 4 (only) may obtain special rates 
of $3.00 each. 

Another important feature of the show, is to 
be able to attend Free seminars being held at 
the show. There will be many speakers that 
Commodore itself will l>e featuring. 

Last year, TPUG featured many speakers, on 
the Saturday and Sunday, and will do so again. 
Some of these are: Paul Atchison (CP/M fame), 
Jim Butterfield (what should 1 say?}, Don Gray 
(author of "Computing for the Absolute Klutz ^), 
Paul and Peter Hughes (the twins who do so 
well with computer graphics), John Moore 
(whose forte is the sprites/sound area on the 
C64}, Brian Niessen, Chris Smeets (Arc Author, 
file handling expert), Don White (whose inter- 
ests are for MS/DOS), and Steve Punter (tele- 
com municat ion s). 

TPUG is still waiting to hear from Fred Fish, 
Keith Falkner, and Wayne Schmidt, amongst 
others. 

The TPUG Conference speakers will be in 
the French Room, down the hall and around 
the corner from the main show. . . just follow 
the arrows. Stop by at the booth to pick up the 
speakers' schedule. 

The third area of speakers will occur right on 
the show floor. Last year, the 20 minute mini- 
sessions held by software houses (eg Berkeley 
Softwork's GEOS demonstrations) were ex- 
tremely informative, and will return, by popu- 
lar demand. These mini-sessions are presented 
the entire 4 days of the show, so one can hear in 
this section alone, at least 75 sessions! 

Those who have never been to this show, I 
heartily recommend you do make plans to 
attend. Too many times I hear, at the TPUG 
booth, "We had no idea the show would be so 
large, and interesting. . . we thought we would 
go thro' the show in a morning/ afternoon, and 
have plenty of lime for seeing Toronto. . . now 
we have to make a choice. . . Next year, we 
plan on staying at least one more day." Be 
forewarned! (and with the American exchange 

rate, . , the bargains!) 



TP JE CQI^ITflCTS 


i PUG OFHCE 


5300 Yonge Street 


Toronto, Ontario 




M2N5R2 




416-733-2933 


Membership Info: 


Regular Member (attends meetings) $35.00 Cdn. 


Student (full-lime, attends meetings) $25,00 Cdn. 


Associate (Canada) 


$25.00 Cdn, 


Associate (U.S.) 




$25,00 U.S. 


Associate (Overseas - air mail) 


$45.00 U.S. 


RoanI of DiT^cton 1986/87 




Pre5i(ten[ 


Anne E. Gudz 


c/o 416/733-2351 


Prt^l Preside nr 


ChrisB^neft 


c/o 416/733-2933 


Vice-Presi«leni 


Carl Epswin 


416/492-0222 


Vicf-Presdenr 


Meyer Tools 


4I6/229-270U 


Secreiary 


John E^ston 


416/251-1511 




D^vidBr^ley 


c/o 416/73,3-2933 




Rshard Bradley 


c/o 416/733-2933 




Geon^e Davis 


c/o 416/733-2933 




Milu^r>f)neijan(evg£.) 


416/639-0329 




J. AlLan Farquharson 


c/o 519/412-7000 


More ConlKts; 






COMAL 


Donald Dal:ey 


c/o 416/733-2933 


SuperPET 


Avy Woise 


c/o 4 16/733-2933 


VIC 20 


Anne E- Gudz 


c/o 416/733-2933 


HardwaE? 


Frank HuTchings 


c/o 416/733-2933 


Mvcling Cuurdlnalari 






C-fi4 Chapler 


Ken Poulton 


416/492-9518 




AnneE. Gudz 


c/o 4I6/T33-2933 


Easlside Chapler 


Don Farrow 


c/0416/733-2933 




Jim Hamilton 


C/04IS/733-2933 


Westside Chapter 


John F-35lon 


4lfi/2!^l-l51l 




AlF^rqiiharsnn 


519/442-7000 


Brampton Chapter 


N{jrrmn]-ro^ 


c/t> 4 16/733-2933 


CI28 


George Skinner 


c/o 4 16/733-2933 


Amiga Wesr ChapKc 


Mike Don^n {evgs.) 


416/639-0329 


UbrarlaiM 






COMAL 


Vkror Gou?h 


4I6/677-S840 


PET 


John Easlon (ev^.) 


4I6/25I-I5H 


SuperPel 


BtLI DutfiekJ 


416/224-0542 


VIC 20 


Ernie Chomy 


c/o 416/733-2933 


Commodore 64 


Gec^rge Davis 


c/o 4 Ifi/ 733-2933 


B-128 


F^ijl Aitch^sr^ 


c/o 416/733-2933 


Am^ 


5yd floJton (evgfi) 


519/753-6120 




Adam Whire {evgs ] 


519/279-9162 


Commodore 128 


Jam«Kokkinen 


c/o 416/733-2933 


MS/ DOS 


Colin Jiisra^n 


c/o 416/733-2933 


CP/M 


RayWhjckSen 


c/o 41 6/733-2933 


TPIXj TekcommunkaUoiu LtDcs 


Quantum Link 






Sysops 


David Bradley 


ID: DavBradley 




Jane Parris 


ID- JancParrJb 


conlacl^: 


TPUGMAIUTPUGPRES_ 


TPUG Rill feliDBfiBrd 






SyMp (™«:e, weekdays} 


Sylvia GalLus 


c/o 416/896-1446 


Assislant Sysijp 


5<eve Purfier 


c/o 416/896-1446 



TPUG BBS 

(416)273-6300 

(416)252-8481 

24 hours per day 
7 days per week 
The password is. . . 

WORLD 



2 TPUG News 



The 1581 Disk Drive 



by George Skinner 

The Commodore 1581 Disk Drive is a very 
interesting drive in that the three and a half 
inch disk has a storage capacity of 802,960 
bytes free when formalled. The 1571 Disk 
Drive has 349,696 bytes and the 154) has 
174,848 bytes when formatted- I believe 
most people have seen the three and a half 
disk, but what are the advantages of this disk 
besides the physical size? The most notice- 
able difference is the hard plastic outer case 
that protects the read/write portion of the 
disk itself, and the sliding metal dust cover 
that shields the memory surface from dirt. 
This metal shield is spring-loaded and opens 
when the disk is placed in the drive. This 
advantage makes the disk ideal for children's 
use because of its durability. 

The 1581 Disk Drive physical dimensions 
are five and a half inches wide, two and a 
half inches high, and nine inches deep ex- 
cluding power and serial cables. The drive 
also has the DIP switches to change the drive 
numbers. The drive has a separate power 
supply and consumes 10 watts of power, 
keeping the drive itself cool, and therefore 
the drive could be placed in a confined area 
without the problem of overheating. I am not 
saying the drive could be placed in a tight 
location, but the drives could be stacked or 
placed on top of one of your other drives to 
conserve desk space without fear of over- 
heating. 

Although Commodore has not stated the 
serial transfer byte speed, if is safe to say that 
it is a lot faster than the 1571 drive, and 
nearly as fast as some hard drives. The drive 
handles all BASIC 2.0 and 7.0 commands 
and therefore can be used with nearly all 
Commodore computers. 

The formatted disk can handle 296 files 
per DSDD diskette, and only DSDD diskettes 
should be used. The disk contains 80 sectors 
with sectors (0-39) and (4 1-79). The diskette 
can partitioned using a program called Tarti- 
tion Aid', which segregates the disk into 
smaller disks allowing the use of root and 
sub- directories similar to the Amiga. 

In the box with the drive is a "1581 Users 
Guide' containing 128 pages of information, 
cables and power supply, and the 1581 
Demo/Utilities disk. The book briefly talks 
about some of the programs and technical 
aspects of this drive. The book talks about 



burst mode, internal operations, commands, 
and the track cache buffer. All in all, a sturdy 
book with lots of information regarding this 
drive. The Demo/Utilities disk contains 
some new programs written for this drive: 
such as the Partition Aid program to create 
root and sub-directories; Uni-copy a copy 
program that copies programs to partitioned 
directories (root and sub-directories), and 
other drives; Show BAM, which is required 
to show the allocated areas on a disk, with 
most programs being of excellent quality- 
One program demonstrates the speed of the 
1581. Called Tic Demo 128', it is a graphics 
program with a dissolve feature, similar to a 
program called 'Cslide Show 128'; however, 
this program is different in that the graphics 
are in a sub-directory on the disk called 
'Pic.Dir' and is 400 blocks in length. Some of 
the programs on the Demo/Utilities disk are 
for the C-64 owner, some for the C-128 
owner, and the rest can be used on either 

computer. 
The sub-directories of a disk are easily 

visible when listing or printing a directory of 
a diskette. Where the type of file is shown on 
the listing instead of ^SEQ', "REU 'PRG\ or 
'USR' file designation you will see 'CBM': for 
example: 

400 'PIC.DIR" CBM 

The only problems 1 have seen so far is a lack 
of documentation for 'Partition Aid" and Uni- 
copy, although Uni-copy is fairly intuitive 
there should have been a couple of sentences 
about the program. Partition Aid does need 
some documentation as what is mentioned 
in the book is generalized and would be very 
confusing for the new owner Show BAM is 
very straightforward but there should have 
been a short sentence stating that to display 
the BAM of the 1581 you have to step 
through the other disk drives. To accomplish 
this a disk has to be placed in the other 
drives and the program stepped through the 
drives until the BAM of the 1581 is shown. A 
short help screen can be displayed by press- 
ing <RETURN> and the simple letter com- 
mand appears on the screen. 

The 1581 drive is an excellent piece of 
hardware, although there are a couple of 
minor problems. When an error condition 
on the drive occurs the drive light does not 
always flash but the power light blinks 
slightly and I have to use the Initialize corrf- 



mand to clear the error. The disk drive is not 
for the person who purchases his first drive, 
as there are no commercial programs availa- 
ble yet! It is perfect for a second or third 
drive. If unprotected software is purchased 
the program could be easily copied onto a 
disk using a copy program and in this way 
used as the first drive. It would be very 
handy for the person who must load or save 
large prc^rams to a disk, or needs to reduce 
the size of their computer setup. 
Altogether an excellent product from 

Commodore, and at the price of $400.00 
Canadian approximately, will be handy for 
most computer owners. 

The large storage capacity of this diskette 
of slightly over 3100 blocks, will be of inter- 
est to those who may be thinking about a 
small hard disk drive for their personal use. 



MEETING SCHEDULE 

C128: 1st Tuesday of the month: 

l987:Nov3Decl 

1 988: JanS Feb2 Marl Apr 5 May3 Jun7 

Amiga Central: 2nd Tuesday of the month: 

1987:NovlODec8 

1988: Jan 12 Feb9 MarS Aprl2 MaylO Junl4 

C64: 4lh Tuesday of the month, except Dec: 

1987:Od27Nov24DEC15 

1988: Jan26 Feb23 Mar22 Apr26 May24 Jun26 

All the above meetings commence 7:30 pm in 
Ihp York Public Library, 1 745 Eglinton Ave W 
(just east of Dufferin}, in the Auditorium or 
Story Hour Room 

Westside: 2nd* Tfiursday of \he month 

19S7:Novl2DeclO 

1988:Janl4Febn MarlO Aprl4 Mayl2 Jun9 

Amiga West: 2iid* Thursday of the month 

1987:Novl2DeclO 

1988:Janl4Febll \farlO Aprl4 Mayl2 Jun9 

• Formerly 3rd Thurs, The above two meet- 
ings lake place at Clarkson Secondary School, 
Bromsgrove Rd. just east of Winston Churchill 
Bivd^ Missjssaugajn the Little Theater 

Eastside: 2nd Monday of the month 

1987: Nov9Decl4 

1988:Janll Feb8 Mar7 April May9Junl3 

at Dunbarton High School, in the computer 

room (north on While's Road from Ihe traffic 

lights at Highway 2 and While's Road to next 

traffic lights; turn left to parking lot. 

For further details 
- pleagyphone the TPUG office at 733-2933 



TPUG News 3 



Yes, There IS a Difference 
Between Micros and 'Big' Computers 



by Ge<rffrey Welsh 

For a long lime I've been announcing proudly 
that the distinction between microcomputers 
and ttieir bigger brothers was slowly disappear- 
ing. The 68000 family, the 32000 family, and 
now the 80386 processor are catching up on the 
speed and power found in minicomputers like 
the Syslem/34. the VAX series, and even main- 
frames. Bui 1 didn't consider a few things that put 
the dividing line there to begin with, 

Stewart Martin, president of ProLine Software, 
once said to me Ihat the 4K PETs weren't good 
for a whole lot, except that they taught us that 
any program we wanted to run on a micro would 
have to be written - and written well - in 
machine language for size and speed reasons. 
Without realizing it, he stumbled across the 
dividing line between micros and 'big' com- 
puters. 

Nearly all of the prc^ramming being done on 
mainframe-type computers was done in a high 
level language like COBOL or FORTf^N and 
compiled to machine code. Even the compilers 
were written in a high level language on a 
development system. And they weren't very 
efficient; a compiler must second guess what iha 
user meant to do with a certain instruction and. 
if a single precise intention isn't obvious, the 
compiler must write code to do everything that 
the high level command might mean. If you 
wanted the program to run faster, you simply 
added more processors or more RAM to your 
computer, or you went to a larger computer. Of 
course, that all cost lots of money, but the 
owners of these computers were mostly govern- 
ments, universities, or lar^ companies so, while 
budgets were limited, they were far larger than 
individuals or small businesses could afford- 
On mk:ros, we were limited to one processor 
and only so much memory. And compilers gen- 
erally weren't available, and none could accom- 
plish in the limited memory what could be done 
with machine code. So, any applications pro- 
grams had to be written in assembler, and one 
needed to know the machine inside out to write 
an application program for it. But the PET wasn't 
hard to learn; with a little help from a tattered 
photocopy of Jim Butterfield's 'memory map', 1 
soon discovered all the PEEKs, POKEs, and 
SYSes one might use from BASIC. I knew all the 
I/O chips and what every bit in them meant. 
And 1 knew most of the ROM routines one could 
JSR to. 6502 was challenging to someone who 



had taught himself BASIC, but it took very little 
time to get to know the machine's innards so 
that 1 could write prc^rams in assembler. 

The 64 was a bit more complicated; the rules 
of the I/O chips changed, and the serial bus was 
the Rosetta Stone beside the lEEE-488's Dr. 
Seuss. And 1 learned quickly that many things 
can go wrong while you have the ROMs 'banked 
out'. But \ learned how to sidestep all of this, 
mostly with the help of the C64 Programmer's 
Reference Guide and The Anatomy of t^e Com- 
modore 64, 

When 1 prepared to settle down and do some 
serious applications prt^ramming on the 128, 1 
found things were another degree more compli- 
cated. Memory management units, bank config- 
urations, DMA RAM cards, indirect access to 80 
column video RAM, 44K (count it all!) of ROM - 
so much that I couldn't hope to memorize all the 
calls - and a serial bus that throws a curve or 
two at people who didn't quite understand the 
logic {or lack of it) of the VIC/64 version. The 
point is, even if I was a very profk^ient 6502 
programmer, it would take so much longer to 
know the 128 as well as I knew the PET. There 
was just so much more machine involved. 

1-et's take a look at the Amiga. A distributor 
once asked me when we were going to see really 
good word processors for it. Much of what's out 
there for it (and this isn't limited to word proces- 
sors) is slow because it was written in a high 
level language and compiled. Eventually there 
will he those who know the machine well 
enough to write software for the Amiga in as- 
sembler, but it can't help but take longer than it 
did for the PET, Apple, or 64, simply because the 
machine is so much more complex. 

How long is it going to be before we build 
micros so complex that no one will make the 
effort to write in assembler? Certainly the C 
language will help in that it allows programmers 
to get at the bits, bytes and memory of a machine 
and that helps them code more efficiently. But 
it's not assembler and it. too, will lose its effi- 
ciency as programmers lose the specific hard- 
ware familiarity with the machines they write 
for. The programmers will be forced to rely 
increasingly on operating systems and compil- 
ers to take care of the machine-specific things 
they don't have time to learn. They will lose not 
only efficiency, but also reliability; if someone 
uses a compiler to write a word processor and 
the compiler makes a mistake, it is the WP 
author and not the compiler author who gets 



blamed for the resultant bug. It doesn't really 
matter, though, as the result is that the users 
don't have the reliable prc^ram they paid for. 

So, whi!e my friends in the mini business brag 
that all they have to do to use their System/34 
COBOL prc^rams on a System/36 is change a 
'4' in the source code to a '6' and recompile it, 1 
am sad to see micros demand that programmers 
use high level languages. Let's face it, programs 
like PaperClip and VisiCalc would have been far 
too slow to be worth buying (not to mention too 
la^^e to exist in the limited memory) if they'd 
been done in any language other than assem- 
bler. 

If we move to a more powerful computer and 
its complexity prevents us from writing our ap- 
plications in assembler, we can say that the 
machine is no longer a true micro, but a 'big' 
computer. That's where I draw the line, and the 
Amiga may be only just this side of that line. 
Perhaps the -386 machines are already on the 
far side of it, 

A microprocessor-based machine that 
matches the power of a mainframe will probably 
not be a 'true' microcomputer in the spirit of the 
Apple, PET, or 64. It will be just be a smaller, 
cheaper mainframe and it will never provide the 
performance /prk:e ratio that the 'true' micros 
do. And the "true' micro may be a dying breed. 

But, performance /price ratios aside, the main 
reason I like the micro over the 'big computer' is, 
quite frankly, polish, I'm no expert on minicom- 
puters or mainframes, but I have used them just 
enough to know what I don't like about them. 
And, as anyone who has moved from PaperClip 
on a 64 to XEDIT on a mainframe will attest, the 
extra power of the machine does not, in any 
way, contribute to the overall polish of the soft- 
ware it runs. Big computers run on the theory of 
brute force over ignorance; if the pn^lem is too 
complex, build a bigger and faster computer and 
ignore the cost. With the microcomputer, pro- 
grammers must accept constraints of cost (and 
therefore of speed and memory) when ap- 
proaching the same task. Any fool can write a 
text editor for a mainframe; if you need another 
feature, just add it because there's plenty of 
room. 

On the other hand, it takes a Real Program- 
mer to come up with a full-featured word proces- 
sor on a micro. And the result of Real 
Programmers taking a real interest in their work 
is, I'm glad to say. a product of superior polish 
and value. 



4 TPUGNews 



Jim Butterf ield 

A-l in past, present and future incarnations 



•i 1 



by BUI Cumberland 



In the late 1 950's, when transistors were beginning 
To replace vacuum tubes in electronic circuits, 
waves of panic swept through the ranks of techni- 
cians and engineers who didn't understand ttiese 
new devices. As training officer at CN Telecommu- 
nkralbns, I frantically searched for a transistor 
specialist to join my group. There was no shortage 
of engineers and physicists who were prepared to 
preach the new gospel according to the "theories of 
drifting holes", but what was needed was someone 
who could transmit a truly practical understanding 
of transistor applications. 

I heand a rumour that a technical supervisor out 
in the Yukon was writing articles on transistor 
theory and applications for US electK>nic5 maga- 
zines. A bit of dicing produced the articles. Good 
grief, even I could understand them! This was the 
man we needed to bring solid-slate enlightenment 
to CNT 



Within days the elusive JFB had been tracked to 
Whitehorse where he was confronted and proposi- 
tioned to come to Toronto. Naturally reluctant to 
leave the True North Strong and Free to sink into 
the Toronto swamp he balked but, driven by pure 
desperation, my eloquence prevailed and Jim 
joined our training team with the label System 
Instructor - programmed learning. 

Jim soon headed the team of instructors who 
trained the technicians for the massive Montreal- 
Vancouver microwave system. From the very first 
day on the job, Jim's new microwave technicians 
set a performance standard of 99,99% reliability. 

In the midst of the scramble to train microwave 
technicans, the first of a series of great multi- 
million dollar computer systems appeared on the 
scene. There were fresh waves of corporate panic 
as this latest technolc^ical monster appeared, Jim 
was thrust into his next incarnation to play a major 
role in programming the new monsters. 



Later, Jim moved into the niarkellng area where 
there was a need to exploit the potential of our 
facitilies to meet increasingly sophislicaled busi- 
ness communication needs. Regrettably for CN/CP 
Telecom but fortunately for thousands of people 
around the world, at this point, Jim's talents were 
grossly unappreciated and he rocketed off into yet 
another incarnation - the international GURU of 
Commodore, 

Unlike other intellectual giants that I've encoun- 
tered over the years, Jim never displays a trace of 
arrogance when dealing with those less well en- 
dowed with gray matter. He will quickly shift down 
to that person's intellectual level without a trace of 
condescension. This rare quality endears him to 
Ills friends around the world. 

Post script; IVe forgiven Jim for stealing and 
marrying the best secretary-den mother that ever 
existed! 



TPUG DISK ORDER FORM 

5300 Yonge Street Dept 01 Willowdale. Ontaria M2N 5R2 

(416) 733-2933 

Welcome to TPUG, the vwDrld's largest Commodore Users Group 
One Of the reasons for belonging to a dub is to gain access to some 
ot the thousands ot public domain programs that it has in its library. 

As a small thank you for sending in your order, we have reduced 
the price of the FIRST disk you purchase to $6.00, The balance 
is at the regular price of $10.00 by mail. Every 4th disk is FREE! 

Disk Number Disk Name Price 

$ 5.00 

$ 

— $ 

$ FREE 

_^ $ , 

__ $ 

$- 

$ FREE 

$ 

$ 

$ 

__ $ FREE 
__ $ 



1. 

2. 

3. 

4. 

5, 

6. 

7. 

8. 

9, 

10, 

11. 

12, 

13, 




(use addittonal sheets if necessary) 



Subtotal 
Ontario residents add 7% Sales Tax 

Postage/Handling 

TOTAL 



$ 
$ 
$ 

S 



3.00 



Name: __ 
Company: 
Street: 



City/Prov/StaTe/Country/Zip 
Visa: D Mastercard; D 
Card #: ^ „^ 



Cheque; D 



Please Check one 
__ Exp: 

I understand ihaH TPU3 is nol habli! lor dny danages !hat may reyull el^^e^ direclly, oi indirecUy, 
from the use oi Ifie software available m iis catalog. I also ur>derslarKi Ihaf some of the producls in 
Ihis caiatog are avaHaWe on a Shareware base I agree thai I cannoi assume ownership of rf>ese 
products. TPUG IS a Commodore LKer's fpnup. TPUG provides a means by which Commodore 
users around the workj can obtaff^ public domain and Shareware programs 

Signature: 

Tetephone: 



TPUG Membership # 



TPUG, Inc. 

Dept, 02 

5300 Yonge Street 
WJIIowdale, Ontario 
M2N 5R2 
(416) 733-2933 

TPUG is the World^s Largest Commodore Users Group- 
It was founded in Toronto in 1978 and has been 
serving its members since that lime. 



Disk of the Month 

12 Monthsofthe latest, fabulous Pul)licDomainSottwarefor only $79-95* 

Subscribe now to receive ttie TPUG Disk of the Month [SEE BELOW] 



PLEASE PRINT ALL INFORMATION 

Name: 

Address: 

City; 

Prov/State: , 

Postal Code 



Home Phone 



Business Phone 



TPUG Membership # (if available) 

Visa: D Mastercard: U Cheque: D Please Check one 
Card #: --™ Exp: 



TypeofDisk: 0064 D C128£1541 Only) □ Amiga (3 V2 Disks) 

8 Disks Only 

I understand Ihal TPUG is nor liable for any damages thai may result eirher direclly, or 
indirectly, from the use of the software available in Disk ol the Month. I also understand thai 
some d the products in this Disk of the Month are available on d Shareware basis. 1 agree 
that I cannot assume ownership d these products. 

t79.9S Canadian lunds. U S members will be chained S79.95 Canadian on their CTedit cards, fijr 
U.S. cheques, please send SS9.95 U.S. funds. 

SIGNATURE 



TPUG News 5 



Pocket Modem 1200 
From BOT Engineering 

For Commodore 64 and 128 



Review by Geoffrey Welsh 

Remember when BOT Engineering released the 
Pocket Modem 300? h was a good 1 650 clone in 
thai it worked exactly the way the 1650 did and 
provided at least ttie same level of product and 
data quality that the 1 650 did. And BOT claimed 
that k would later be upgradable to 1200 baud. 
Some hoped, others laughed. 

BOTs first 1 200 modem was the PM-2 1 2. Not 
an upgrade to the Pocket Modem, but a fine 
Hayes clone unto itself. It had only five LEDs to 
Hayes' eight and came in a much smaller case, 
but it obeyed the full set of f^ayes commands 
and S registers and provided data quality compa- 
rable to the other clones out there. I even put it 
on my BBS for a day and it worked flawlessly 
with software thai normally works with only 
good Hayes clone modems - but only after I 
changed a default switch setting. BOT Engineer- 
ing had put the switches inside the case, so one 
must open the modem to change them. 

However, the PM-212 appeared to be one of 
the best values in Hayes clone 1200 baud exter- 
nal modems. 

Just recently I have had a chance to play with 
the Pocket Modem 1200, BOTs "plug it straight 
into the computer" 1200 baud device. While 
clearly a new modem and not just an upgrade to 
the Pocket Modem 300, this device packs a lot of 
wallop into a small box. Only Vh' tiy Vh' and 
about an inch high, this may prove to be the 
smallest 1200 baud modem on the market. It 
sports two toggle switches {one to control 
originate/ answer mode, one to set 300/1200/ 
software selectable baud rates) and a carrier 
detect LED. 

Data quality proved good and as long as I set 
the baud rate with the toggle switch, the Pocket 
Modem 1 200 worked superbly with my terminal 
program in 1650 mode - even at 1200 baud. 
Although most software on the market will re- 
quire you to set the switches in this way, the 
sohware selectable baud rate setting allows for 
new or modified software to do the setting for 
you. BOT even includes a BBS program in its 
package (which I did not test, mostly for reasons 
of time) to show that this setting allows one to 
run a 300/1200 baud BBS with this modem. 

BOT also includes a copy of ThirdTerm. That's 
nice, because Tm really sick of people telling me 
that they just got a new modem and thai they 
don't krK)w how to download with their termi- 
nal. First of all, very few modems come with 
terminals CAPABLE of downloading, and every 
one operates differently It seems Ihat every time 
a new modem came on the market, a new 
terminal would accompany i1 and weM all have 
to stop and lake a look at it to find out how it 
worked so we could answer all the questions. 



Although I don't use ThirdTerm. several people I 
know do, and it's nice to see a modem manufac- 
turer including a terminal ihat is actually used 
by people who have a choice. 

Now I will get to the only major drawback of 
these otherwise fine devices. With both the PM- 
212 and Pocket Modem 1200. BOT has tried to 
provide inexpensive modems for various mar- 
kets. It seems that, to cut costs, BOT has also cut 
corners. At a store 1 occasionally visit, PM-212s 
are being returned with developed defects. A 
look inside them suggests that they were 
'zapped' by high voltage spikes on the phone 
line, probably caused by electrical storms. The 
Pocket Modem 1200 probably faces the same 
fate. I don't know how much BOT saved by 
omitting 'zap protection' from their modems, but 
BOT's prices are simply not low enough to justify 
such a major omission. 1 suppose those with 
phone line surge protectors have nothing to 
worry about, and anyone willing to build or buy 
one need not avoid the BOT products. But the 
bottom line is, with this kind of damage possible, 
I would rather pay the few dollars that the BOT 
modem would have saved me, and stick to a 
more robust unit- 

For Information, contact BOT Engineering in 
Milton. Ontario at (416) 875-0525. 



The Sentry 

From Firebird 

Graphic StralGgy Game 
For Commodore 64 



Review by Ben Vecchio 

Imagine pitting yourself, via your robot emis- 
sary, against an energy-al>sorbing Sentry who's 
guardian of an alien landscape. Your mission is 
to move your robot to a point higher than the 
Sentry, absorb him, become ruler of the land- 
scape, and thus be able to hyperwarp to the next 
higher landscape in this universe. 

The Senlry is a challenging graphic strategy 
game much akin to chess but with the added 
excitement of timed movements. You've got to 
either hide or move quick enough to elude the 
gaze of the Sentry or one of his agents like 
meanies and f-andgazers, who force you to move 
from your current location, making you expend 
energy and sometimes causing your robot to get 
destroyed, or more likely atisorbed, by the sinis- 
ter Sentry And that's what the Sentry strategy 
game is all about: absorbing and expending 
energy. 

You are in a world where the only constant is 
energy and time is measured by the inevitable 
scanning of the Sentry and his agents. In your 
quest to absorb and replace the Sentry you must 
accumulate energy by absorbing any of the vari- 
ous trees that dot the landscape. However, to 
absorb anything you must be able to see the 
square that it is on. 

The entire landscape is made up of various 



levels of coloured squares that you, in your 
robot, traverse. You do this by creating a new 
robot shell on a square in an area you want to 
be, transfer yourself into the new robot, then 
look over to the square that your old robot is 
occupying and absorb it. 

Along the way to absorbing the sentry you 
must also build boulders and trees to aid you in 
your quest. Boulders are used for climbing up on 
and to see if the Sentry is scanning a certain 
area. If he is, the boulder you created gets 
absorbed and turned into a tree. 

The trees are of a sufficiently low energy level 
that they aren't absorbed by the Sentry. This 
being the case, they make for excellent scrim- 
maging when the Sentry's scanner eye comes 
around, and that will only work if you can 
directly block the Sentry's view. 

In the beginning levels, the strategy is to move 
and climb in the same direction the Sentry is 
rotating and to get enough energy to absorb the 
Sentry and hyperwarp to another landscape, 
preferably one much further along in the list of 
10.000 landscapes. 

! had to absorb the Sentry in the first land- 
scape three times in order to get to another level . 
The first and second times, I absorbed him but 
did not have enough energy to hyperwarp, and 
was killed. The third time, 1 went a little slower 
and absorbed a lot more trees and was able to 
get from level to 7 in one jump. When you go 
to a new landscape, you are given a secret code 
number to access it; better write down the code 

number so that it's easily retrievable, because if 
you forget it and can't find it, it's back to level 
zero again. You can use a blank white page in 
the back of the manual to write your secret pass 
numbers in. 

The thrill of the Sentry is eluding its energy- 
draining gaze, getting to the top and absorbing it. 
You have to be fast and sure, realizing it may 
take many attempts to make any progress. But 
stick with it and you'll be greatly rewarded with 
chills and thrills. 

As you turn and survey the landscape, inevita- 
bly your sensors will tell you that you are being 
scanned by the Sentry or a Landgazer - you'll 
have to think and react fast! You'll line up your 
sights to jump— but it may be too late- Your 
energy reserves are low and as the sentry ab- 
sorbs the rest of it you don't even have enough of 
it to jump, and then it's all over; your worldview 
disintegrates and you are cast into darkness.-, 
only to start over again. 

The Sentry features demanding strategies 1 
have never before enountered. Each landscape 
is represented in really stunning solid-modelled 
three dimensional graphics. You will probably 
never complete all the landscapes offered in Thr 
Sentry, but with the challenge it presents, you'll 
get hooked trying- 

The Sentry is disk-based, has a suggested 
retail price of $39-95 and comes with an illus- 
trated booklet, quick key guide and a free pin-on 
sentry button. Right now the Sentry is only 
available for the C64/128. 



6 TPUGNews 



Chess and 

Computer 

Chess Boards 



by Mnceot J. Mooney 

The Greater London Council Chess Challenge, 
held from March M to March 27, 1986, in 
lx>ndon, England, introduced a new computer 
technology to keep track of the moves. The 
moves were *'watched" by a computerized chess 
board unit. The chess boards and pieces looked 
normal, but they contained hidden electronic 
devices to monitor moves. These pieces were 
later used at the 1986 Kasparov versus Karpov 
World Championship match- The first 12 games 
were held in London, England, 

The pieces and the board were developed by a 
London-tiased company. Inleiligeni Chess Soft- 
ware, Ltd. Each of the pieces contains a coil of 
wire, and there are electronics under the board 
that can detect how many turns of wire are in the 
piece above each particular square. In this way, 
the computer recognizes whether or not a square 
is occupied, and if a square is occupied the 
computer knows which piece type and colour is 
on that square. 

Every few seconds the board transmits the 
current position to an IBM personal computer. 
This also happens whenever a piece is moved. 
The transmission of data to the computer irom 
the board uses a single cable. The IBM computer 
converts the position into a coloured graphic 
display that can be seen on television and large 
screen monitors. For the Karpov vs. Kasparov 
match, a direct link from the computer to the 
BBC's computer at the BBC Television Centre 
was made and, from there, the display was sent 
directly to television sets in Britain, Belgium and 
the Nelherlands- 

This game monitoring system solved a tradi- 
tional problem of chess tournaments - how to 
keep the audience informed of the state of the 
game. The old solution was to have a person 
watching each game and, in the case of a tourna- 
ment such as the GLC Chess challenge, watch- 
ing tv^^, three or more games. The person then 
moved pieces on a wall board after each move in 
the game. The wall boanj staff often had tnnibles 
near the time control limit, because moves oc- 
curred rapidly and tiecause their physical pres- 
ence, needed to view the board, was annoying to 

some players. 

The new ^stem removes the need for a hu- 
man recorder on each game, and keeps up with 
the play no matter how fast the moves are made. 
It also permits game displays to be transmitted 
over very long distances. The chairman of ICL 
Ltd. is British International Chess Master David 
Levy. The ICL system may well become the 
standard system for many tournaments. 



TPUG LIBRARY AlffimONS 

TPlCtQAANAtig'ST 
DMKiftheMinlh 

Ptesenied by Ken Poullon 
76 blocks free 

The fiisr prt^ram (Ullr* Seq-Prtat V5^) on Ihisdbk Is courtesy d R.W, 
Kober. Ii K an eidremely wdl documemed prAiram Ihal allows one to 
vie\v on screen nr pnni sequenlwl files. Il sends lo Ihe pnnler in either 40 
or SO characTer iiK)6e. Oiie has Ihe option, as well, d [sinfirig the 40 
chatai:ter oiapiii in one cohinin or fwo! Also included are disk housekeep- 
ing nwjlines (saiitch, rename, ksnal, view], behind a well thoughl ool 
and well planned menu screen. This program is a must for anyone who 
has any reason to read sequential files. 

Robber* isa fasl actkjn, cotourful, cops and robbers mulliscreen resaie 
arcade game by Mike Davis, invoLvtng diamonds, ghosis, safes and 
mines. 

The Script Analyib program by Bob Spif ho does nin excellent )ob of 
analyang a persoEi's hand willing. Results may be saved onio disk, tape or 
sen! to pnn)er 

BeetrtHik Dkry by zenyaHa lets one enier and read iiems that one has 
saved to disk. There are some disk bousekeepflng lealuras as *bI], such as 
lik deletion and calakiguing. 



64 power plant 
weathennan 



TPUG Disk Library Supplement 

Keep Ihe Nuclear Powr Plant hwn a MELTDOWN! 
Wealher calculator fcw winter wind<hill faclors. 



tapdabler.p 
guitar frets, p 

gtaph sprimSO.S 
gtoan.p 
geo-wealherz 
marine efc«OT.p 
open pit mine.2 



pnnter chai.8 



apl 
paykiad v2.p 

insir payload.w 
fe-80 fonts Ji 



EZDISK by Jim Branberg is an iilility program fhai alkfws a number o( 

hjDctions, such as view, scrarch, rename, inHialize, validate, kjrmai and ban pmis v2.8 bus 

mosi imporlanlly, lo uiiscralch a splat (<)fite! 



CROSS-REF 64 comes to us from Jim Butterfiekl. l! is a liny powerful 
pn^ram, foi Ihose who like W wrile Bask: Programs, or read ofher 
peoples' BASIC code. 

The last item on the disk is a Spanish I Dictionary Program, thai Iransiaies 
English to Spani.sh ^ vice ve^sa. More is availaWe horn Ihe aulhor, K.E. 
Clayton Jr., upon nominai chanie 

disk: TPUaMlS MUSICI (QSK 

presenfed by David Bradley 

This disk coniains Ihe MAOC Sl[> MACHINE', a modificaton ot ihe 
'Magic Music Machine V2.0' adapted lo run SklPtayer files. All music files 
on this disk are mits files Selections include; Amadeus, Aquarius, 
California Girls, Chups(k±s, Disco Duck, and many mmy mote. Enjoyl 

The nest two disks are TRJGS firsi diplized musk: disks Each contains 
bul 3 short (less than 10 seconds each playing Time} selec! ions. I am sure 
you will maiwl al how so many blocks were used for Ihe sound 
re^^oduclk^ as you iisten at^in diid ^inl 

i&k: TPtJG DKa MUSIC 1 (QSL 

presented by David Bradley 

-Free Yourself 
-Die Aerzle 
-Woody Woodpecker 
70bkxrksfree 



rec«pts,8 
insIr receipls.w 

- freeware — — 

archimedes 

archimedes 1 p 
archimedes 2 p 
archimedes 1 c 
archimedes 2.C 
archimedes 3 z 
archimedes 4^ 

nolKej 

wo[d pro printer 

aichimedesins.w 



crosswordp 



bin-hex-dec 



compaitblliry 

sprint 

eye ot ihe inca 

kdler E54] 



flips 

form maker 

sklpk: v2.S 

label maker 

iounidl 

report generator 

swinth 



irUG MGI M11SIC2 {CfiiM 

^eesenled by DavkJ Bradley 

-Kun^ Rj Master 
-Flash 4 i^ntasy 

-i^^at 
nS blocks free 

DWi name: lpug(c)BBi> BCp87 

presenied by Ken PouiltHi 

This pn^ram will convert Wnaiy values to hexade- 
cimal lo decimal ALiio hasalesi or quiz lotesi your 
grasp of the program. Good tor conversions 
See if you and your male are compatible See 
compat.doc for more delails. 
Sequential filereadeTforM.Seesprint.doc. 
Text advenlure game for the 64. See if you can gel 
the EVE ol the Inca' and other assorted boofy. 
DcHi't abuse your LS^l or this will happen loyour 
disb Run this graphk program. Simple bul to the 
point. 

Simple liltle game for Ihose who remember Ihe 
game. See doc for more info. 
Data form maker wrth rrnvs and columns jusi like a 
spreadsheet Will prim out [heemptyspaces.Vou fill 
Ihem in. See doc for more info 
Prcgram for playing Ihe .mus, pic and wds pra^ram 
on [his disk. See Sdpk.doc v2 for more info. 
¥or printing out shipping or mailing labels. From L 
Sanders. 

Jim Butferfield's journal for expenses and receipts. 
See fOUiTial doc for more detail 
Ai^n, another of Jim Butieriiekl's cieaflons for 
seeini^ Ihe data file of the [ournal. For priming or 
viewing 

Sound and graj^ic demo from CompuServe. Good 
sounds, some are lamillar. 



x-word filed 



coeffidenl.p 



gradebooli insi.8 
^adebook.8 



addtUe.S 
copyfile.8 

namesB 

marquee.S 



PET LIBRARY ADOmONS 

Ipugapr85(p)ii 

misc print cassette tape content lists 

musk calculate fret posjicns for those Sffltr^ up 

their own guitar 
buss dra^andedEtgraf^sonyournitspriniaO 
game toll dice against the pet, highest score wins 
educ science-geographic weather quiz 
edix: ficfence-graphks showing shorelineerosfon 
educ game- try lo open [Hi mine the athabasca oil 
sands, inckxies cave-ins fkxids and other 
prol>lerrks such as pollulKKi costs 
a program for printers with prc^rammable 
character and image Ijuffers. define your own 
printer characters 
data file for primer charS 
flying calculate the fuel consumption and flying 
time wilh reserve of your plane 
wordpro file - instructions for f^load v2.p 
set up Ihe print control codes for the epson h- 
80 prinler and select print fonts 
calc inferest paid and current balance espe- 
cially for non-uniform payments 
print and record customer deposits 
wofdpro file - inslruchons for receipisS 



util 



data 



data 
ulii 



bus 
data 



- a Sft of prcgtarns for junior high school teachers 
dealing wiih archimedes principle on liquids includ- 
ing buc^ancy and volumes 
pe(/d>m le^on 1 
pel/tim lesson 2 
c64 lesson 1 
c64k!Sson2 

pet/cbm and c64 lesson 3 
pet/cbm and c&4 lesson A 

a message from the author 

util a program to list wordpro files for those that 
haven'l a copy of ihe wordpro word processor; 
note this file lister program is qurte slow! 

dala wordpro file - instruafons and teachers' guide 
for the archimedes freeware programs 

tpugmay8S(p)y 

educatcnal game - generate crosswc^d pusles on 
your computer, given a set of words 
multiple formats can be Ined, then print 
Ihe results 

data file sample data for crosswwd.p 

educational mathematics - find the correlation coeffi- 
cient d two variables, instruflfons in- 
chKJed in the prc^ram 

ediii:ational instroctiotis for the gradebcok pmgram 
educational keep track d a student's grades this 

prcgram is an upgrade of [he prcgram 

giadebk-giades.z on Ipug disk {p|ts 

march H!i 
educatkinal a sub program from gradebook 8 used 

to add or concatenaie tiles 
educahonal a sub prih^ram from gradebook.S used 

to copy files 
educalfonal a sub pr™;;ram from gradeboc*.8 enter 

and modify nances In gtadebook.6 



Hltac a horizontal mouing sign or nurqiiee 

instructions are included in Ihe program 



Ihe following games are from Ihe commodore educational group 
or the Ontario educalfonal software proied 

note - tfie stop key is disabled, and needs Itiktorun 



casttequea.z 
chase,? 
dragon islar^.z 

maze.z 

nuc pow plant z 



game adventure - try lo find the treasure in the 
castle, and avoid the perils whi}e you explore! 

^me 2 player - chase ywr opponent around Ihe 
scieei, avokl obslacles. and score points 

game a vanatfon of the game hunt the wumpus, 
hunt the dragon m the island s cave wiih your 
trust)' spear, but beware trf [he dragon 

game generate maies of varying sizes, then try to 
find your way throut^ Ihe maze running 
a^in^ the ctock 

tpme simulatfon ■ try your hand Bi ninning a nuclear 
power plant withoul the nasty side effecis if 
y^i fail. Balance Ihe h^h temperatures 
needed for po'^'er generatfon ai^insl Ihe tem- 
perature limits oi Ihe power plant equipment 



TPUG News 7 



TPUG Disk Library Supplement 

road hazzards.z 



cbm 4032 v2 



tjnlariodnverp 



diskview 3.z 



presgizmo.p 



game mille bornes - play against rhe com- 
puter try To get to 1000 miles before 
your opponent. 

util convert your 8032 to a 40 column 
machine This program for The commo- 
dore games programs 



education try lo pass Ihe wriiTen exam frw your 
dTivci'a [itence, non-oniario r<^ulari(«is 
may dJIer iJigtillyi 

ulilrty kx?k dl your rtisk ■ byte b> hyte look al 

any block, in hex ot decimal, change a 
bktck. unscnilth av Inct Wocks ot a 
prugram 

hardware l^eifh faulkner presents the user port, 
Ihisispanof hi^ presentation at Ihe tpu^ 
conference This program can be used 
to present other info by using multipk^ 
screens 



ptes rs232.p hardware ^ faiiikEPr prer^iits the t5232 iniertace, 

this is pari o( his prewnlalion af like fpug 
confererkce. Thii^ program can be used 
to present fflhpr info bv Ltsing multiple 
screens 

maralhon racp programs 

this pn^ram will sort njnners in l^i to 26groupsbv' class and lime 

liDc marathon data file for Ihe matarhon insi ? prrs^ram 
soned sub pic^iain for rikataihon track 8 

unson sub program for maratlion track 8 

marathon ltack.8 sports keep track of runners in a marathon race 

maratlion lEist.z sports instructions for marathon track; output oei 

screen or pnnter 



okl bhears.z 

Iot1o?ahlen 2.7 
peniominos-7 
pentominos Jnsi.z 

peniominos-p 

mag index 8 
ccHitrol chrS.£ 

print dir SOSO-Z 

iLslpr.z 



misc anoihetsheepshearingprrgram 

misc k)tto<i/49in german 

game ba»cv^rstono[ the game 

game instructions for the game pentominos from ] 

butlerf^eid 
game machine langudgtf vetskm of the game 

ulll a table of the control characters used on 

vanous caniinodcHe machines 
utl pnnt 805O directories, in 2 columns, aipha- 

beticallv^Hh block count and addresses 
ulil a prc^ram to list word-pro files for edilor x>r/ 

wp see abcft'e 



meter readi[ig.p 
forces, p 

chemistry pmb p 
equivalents, p 

equalionji 2 p 
Canadian geog.p 
key sitinatures p 
periodc prop.p 

dscii/perscii.c 



mouse Mkdzez 

planet landing.? 
pel mdii.z 



diskutil.a 



help disktitil 8 

help use help .8 

help (empty), p 



game ijuide the mouse through Ihe maze 
game land the Canadian Jupiter lander 
game pac man in bask on your pd 



tpuR »(epl AS (p)rl 

utility a disk ulilil>' similiar to disk doctor kfok at (in 
hex or ascii) disk files ar)d blocks; read, 
modrfy, and char^ge any bkick on your disk, 
nole' be vary careful about usiEig the 
change kl command 

instrttclcns for diskutil.8 bad and run it 

urilHy a prc^ram to generate the help instruclkm 
file used above uses the help empty i> tile 

data a dummy data file for help use help.8 

crossword puzzle generator 
also on sept 85 cfi'J disk 



crossword 7/mt.p educational 



cmssi^'ord 7 z 
ciosswonl 7 in .2 
crossword ins] w 
crossword Lns2 w 
cross pE maker z 



cross.pf.jns ] .w 
cross.pf.ins 'Lv 
cross.plJns3.w 
cross pi. ins4.w 
cross pf ins !J.w 



inslrut^ions 

data file 
data file 
utihly 



data file 
data file 

data hie 
data file 
data file 



generate your ow[i Lross"wcfld puzzles, 

petspeed version 

bask version d crossword 7/ml p 

for crossword 7 in basic 

wordproinslrodions for crossword 7 

wotdproinsttuaions for crossword 7 

nidke up your own printer file Nole - 

the disk also coiitains some M primer 

files for various printers 

woidpro - for cross.pf.makei z 

wordpro 

wordpm 

wordpro 

wordpm 



— freewart 



divest.8 business calculates taxes on atSt share-hdders divesli- 

til re [us lax calculations') 
divest insI 8 inslniclions program lo documenl ptc^ram divesl.8 



lpugocl8S<p)tiii 

freeware prc«^ram - there is hiIso a c64 versfon 

further infoniiatkin can be obtained from the author 

lor a fee - sc? documentdtmn included helow 

edilor4032 kJr.f ulil a f^ram to examine and edit the tracks and 

sectors on a disk 
editor 4032 data (usr) file for editor in:i2 Idr f 
editor 00/wp word pro documenialktfi files 
edtorOI/wp editor 01 /wp thru to l9/wp are afeo. . . 
editor 19/wp word pro docnmeniation fi^ 



shears scorini;.?. 
open heats.d 
open findls.d 
ral^ system.i 



misc sheep shearing scoring 
data (sei]) file - for rally system prc^ram 
daia {seq) file - for rally system program 
sports car rally driving - keep track ti conlestanis 
and their points 



holcan - a computer program for estimating the spare heating require- 
ments of residences by r.s. duiiK^I, me, lux and hworr, national 
research council canada - saskatoon, dbr ccHnputer program no 48, and 
no 49, issn 077-5479. price of manuals about $25.(X}-prepdid. From 
publicatfons seclfon of buiklingi rosearcli. nationdl research council 
Canada, Ottawa, oniarfo, canada, kta-0r6. 

the data files with krause in the fik name dre actual measurements and 
data from a.e. krause's hcHise in sasksloc^ sask. canada 

data fifcs f(* oilier Cities can be generated - see manuals, data files Idr your 
own house can also be generated to use this program properly Buying 

the manuals is recommended. This prcijraiii is avalilable for other brands 

of comptHers from national research council canada 

menu pn^ram for holcan - load helfo^ and run, calls 

following modules 

module 

module 

modufe 

module 

module 

module 

module 

daia files for holcan programs 

data file 

data file 

data file temperature and info for cities 

data file lenperature and info for cities 

dala file temperature and lEifo for cities 

data file temperature and info for cities 

dala file lemperariire and info for cities 

dala file temperature and Info for cities 

dala file temperature and info for cities 

data fik^ temperature and info for cities 

dala file temperature and info for cities 

date file temperature and info for cities 

data file temperature and info for cities 

dala file tempera! u re and info for cities 

city data file I - yo<i can set up - see manual 

cilv data fik' 2 

rilv dala file 3 

ciiy dala file 4 

data file from inanau! -no comments included 

note - default data file if non is specifkd 

<k1a krause for full insulatoi attx: basement etc 

data file from manual ■ comments included 



peffoad64.p 



supetmon + p 



disk check.p 



educalknal practise reading electrical meters 

educational study iorce^ motion and vefocity 

educational mDle,nH^arsolutk}nsandpv = nrt 

educational chemistry study - normal solutbns and 

equivalents 

educatkmal math -practise solving math equations 

ediKatxinal Klentif>' Canadian gecgraphicfocatbns 

educational music- read the musx: staff 

educatBiiai peiiodkpropeniesof the elements 

utility convert ascii formal files to petscii format or 
vkeversa^ set tape or disk, device number, 

drive number for input, output to screen, 
printer, tape or disk, set device number, and 
drive number, note, this is a c64 prcsiram use 

pttJoad 64.ploload 
utility convert cM fwograms to lun on the pet note: 

will not fix peeks, pokes, sound, oj graphics 

stuff 
utility supermon for the pet from i butterfiekl: his 

naine was supermm + pei', there is a docu- 

mentatxtn file on djA disk {c]fl 
utililv kxik aland check vour disk 



helfo 

change costs 

add data 

list data 

instruct kins 

liotcan 

exec sub 

output sub 

cilvs 

string save 

ene^ costs 

Vancouver 

edmonlon 

sufTiekl 

swifi current 

saskatoon 

wiiuiipeg 

toronto 

Ottawa 

montreal 

fredericton 

halifax 

St. John's 

first alternate 

second atternale 

third allernale 

fcxitih alternate 

inpdat 



krause.fi.dat 
manual.dat 

krause.sf dat data 

krause.dai data 

krause.ni.dat data 

32k-ediIor4.p ifl^ 

editor64.c utifjty 



krause using space factors caic, - see manual 
krause his house as it exists cTinently 
krause house before adding extra insulatkfli 
before he added extra insulalkin 
32k editor for cbm/pet(sys 7-4096) 
editor for m (load editor64.8,l) sys 12-40% 
10 start editor 



the holcan program has been nKxtified for fik input on cbm equipment. 

educational freeware for Ihe teachers 
nurk master 2 3c educatkinal utility - sfudeni marks recording 



read-me reader.z 


utility 


a sequential file reader prc^rram 


sample marks 


data 


sampjedata for mark master 2.3 


read-me 


data 


dala file(sequential) for read-me reader.z 


calailator.z 


utiHly 


add this subrotHine lo your prtAjrams for 
a calculator function 


resfsTors.z 


educatkinal 


a science tutorial on resistors 


motion .z 


educational 


a science tutorial on motion 


^eclrkiiy.z 


educational 


a sconce tutorial on electricity 




Ipug der B5 (p)tp 


k^ksimadvc 


educational Icgicsimiilatksiadvariced versk^. note: 






this is a c64 prcflram use pdkud 64 p lo 






k>ad 


jk fiip-fiop 


data file 


for kigic simulatkn 


ar>d 


data file 


for ki^ic simulalkm 


or 


data file 


for hjgk: simuiaikin 


hill adder 


data file 


for logk: simulaikxi 


kigicsimc 


educational bgt simutatkin. note, this is a c64 pro- 






gram use petkiad 64 p to load 


these prci^rams are pan of a set started in no%'B5(p)fn 


tesonance.p 


educational study resonance and standing waves in 






SI ri rigs and air 



AMIGA UBR ARV ADDTTlONS 

Presented by Syd Bolton and Adam While 

Notes; Our Fred Fish library has expanded up to Fred Rsh "74 Our 
Tf^G original disks go from (A}T\MA)TAE. The Catafog disk is beiiuf 
updated as Ihe library grows However, submissk)ns have been kjw, and « 
becomes diffkult to prepare original TPLIG nutenal without submisskins, 
so PLEASE send in anything you think we don I have. Thank you! 



(AJTAD 



ProWnle DI^(J. 



FileMaker. 



A DEMO version of ProWriie, the word processing 
pri^ram from Ne\s' Horizons software. Looks prelty 
good the sample files are included in the drawer 
"Sample Documents'. SAVE option is disabled. 
Author says send him tlO it it's worth it This is an 
excellent SprieEditor ..haveakok Documentation 
is Included. Authc*: Scott Lamb 
Transformer Pj«ch A patch that alkws you to use TVansformer with 1 2 
KkkSlart. Source included, musi be executed from 
the CLl - docs on how to do this included. Aulhor 
unkEiown. 

An easy fast and useful utility run from the CLl that 
makes dcsng directories and renaming files a snap. 
7 pictures drawn with the f-asyl. from Anakin Re- 
search Some very impressive stuff. 
A text file expLaming some etiquette, etc. about u^ng 
telecommunkalkins . makes inlerestmg reading for 
both theoW and the new telecommunkators Auihor 
Thad Horvan. 



DiskTool. 
Easyl Inures. 
RkTraasfers. 



Star-Frontiers. 



ShowANIM. 



Aux2. 



QuKkCm. 



LPem. 



RockSlkle. 



CLE. 



l^AE 

This awesome demo utilizes a kti of Am^ power, 
incorporaljiig the blitler and copper, with digitized 
sound (Muiurse, I TPUG" modified ill Looksgreat! 
Aegis' VkteoScape /(D is ftne ri the hottest new video 
products, and this demo hy Allen Hastintp demon- 
strates some of its power, showing a ,'J-dimensional 
"Am^" ball bouncing on some 3-dimenskinal [ot 
C0'jr5e)texi saying "VideoScape 3D" Nice. (QJ) 
This nifty little handler alfows someone on the serial 
port an external CU. Therefore, a buddy could be 
cafi Ing you on Ihe modem and pLdv while you [Jay, or 
two Amv's coukJ be directlv linked t(a;ellier Author" 
Steve Drew. {CU] 

"Hiis Ls actually a BLUE program (ouch!) but works 
]ust great wilh Transformer, and speeds text up to 3 
times!!' Very nice to show people the Amiga isn't all 
THAT jJow ernulatJiig an IBf^. . --THIS LS AN IBM 
ri^0(3RAM, THEREFCJRE YOU f^UST PUT IT IN f^S- 
DOS FORfJAT WITH THE PC-UTILITIES THAT 
COME WrrH EXTRAS l.2!1!" Author: Charles Dav- 

r 

ton. 

This is a MADE IN CANADA (yeah!) cule demo that 

emulates a fong-persistence monitor {sorlHDf) Kinda 

neat I ran it while creating this disk. . . Author: Steve 

Tibbelt. 

This is a compiled TrueBASlC program that is similar 

to BoulderDash Nke title screen, too Author; Jintbo 

Barber For the title screen lo appear, J must be run 

with special instructions included in that direcl0T>'f 

The game VilYL run from the WorkBench ICON, with 

no title screen (shame!) 

Shcflt for "Cc^nmand Line Editor', this substitute for 

the CfJ alk>ws history (ri comntdnds and true editing 

(leti and rb^ht cursor, up and down scroll through 

previous commands). Good. Author: S.D. Haky (CU) 



8 TPUG News 



.'V-:'::^^'.'.J5r};i<^^^ft:^fiS'. 




^^u 






JE f 



U.i Mil 



irrmi4 



I IIIMrilttltMltt^MtUttJ 



it 



^UNiuminuiHi 





^ 




r 



• 







M 



L 

n 






S^ xMfS^^^s:^^^ -jo/ft-^^J 




t 



''^'"^^ 



■'^*iii* 



^' .t^'- 



.^■A 



ill 






^i^-m: 



— ^**i!^ 






4A« 



V 



JA- 



V 



Trsnsac'-. 



^^.V. 







£S^aie9iy- 



■ _ ^ -J 



k'^^^ 






^Jiii 



Transactor Bimonthly Special Offer 

We've been publishing Transactors in magazine format for about five years now and, although 
things have certainly changed on the micro scene during that time, a lot of the information from our 
older issues still has the vibrant glow of youth , Chances are you ' re missing some of those classic T's 
from way back when, so this issue we're giving you the chance to fill those embarrassing holes in 
your library at the kind of pricing that's going to make our flint-hearted accountant, Herman, turn grey 
overnight ~ including his hair. The details: check off any number of back issues on the order card at 
right, and when you're figuring out the price, count $4.50 for the first one as usual (that's to cover the 
handling) but only $2.00 each for all the rest. If you're from Canada, that price is in Canadian dollars; 
anyvittere else in the world it's US dollars. You buy the magazines, we'll pay the freight - but 
please remember that this offer is only valid for orders postmarked on or before January 1 , 1988. 



Itansador 

Hi* hkigmiM tot Cornmodert frograirnnvn 



n Hease send me 6 consecutive ThinsactOIS starting with the next issue! 

□ I'm subscribing to the magazine AND the disk, so please send me my (check one): 
n FREET-Shirt Size: QS DM DL DXL Color: QRed DBlue 
D FREE Potpourri Disk (regular value $19.95 Cdn. $17.95 US) 
D FREE TransBASIC 2 Disk and Manual (value $19.95 Cdn, S17.95 US) 



Subscriptions (D Please send microfiche instead of magazines) 



1 Year 

2 Years 

3 Yesr? 



Canada (SCrin. 



Mag 



Disk 



Both 



DiSJ.ao nss.oo DT-lOO 



□ 35.00 DiOKOO D136.00 



rH7.50 DI3B.O0 ni85.50 



U.S.A. ($US) 



Mag Disk Both 



DlS.OO [1145.00 DGO.OO 



□27:S0 a82.50 D 1 10,00 



□ 37.5a 0112.50 ni50 00 



Forei^M ($US) 


Matf DUk Both 


□ 21 00 055.00 □76.00 


038.50 niOl.OO □139.50 


□ 52.50 □ 38.00 0190.50 



Air Mail ($U8) (Overseas only) 



Mag 



Disk 



Both 



□40i)0 069.00 0109.00 



□ 73.00 0126.00 ^199,50 



□ 100.00 0172 50 D272.50 




Pre-release Subscriplmn Deais (until January 1, 1988 ONLY) 

Ma^a^^ine OCanada S9.50 OUSA S7,50 OPoreign SI3.50 US OAir Mail (Over:>e^ only) 832.50 US 
Disk DCaiiada $36.95 OUSA $29,95 □Korei^n $39.95 US OAir Mail (t^erseas only) $53.95 US 

n ' 31^ already suhsrribing To Transactor -- my subscription # is 



The IMogoikm tor Amioa Prografnin9r« 



D Pled^ swirch my Transactor subscript ion lo transactor for the Amiga starting witti the first issue (no chaise - 

see News BRK). 
□ Ptease DO NOT switch anything! Your pre-release offer !^ loo good to pass up - 1 want lo ojiHinue getting the 
original Transactor AND ALSO get the new Trari^actur ftjr the AMIGA! 



D New Subscription D Reriewal (please include your Subscription Number from mailing label) 
Name & AdHres^^ New address? D . 



(please include your postal/zip code): 



Phone #: ( 



I 



CompuServe ID^: 



SAVE 

28"-64% OFF 
Cover Prices 

28% OFF Transactor 

64% OFF 

Transactor for the Amiga 

Until Janl/88 ONLY 



This card for Transactor subscriptions ONLY. 
For TPDG memberships, write TPUG direct. 



• Ont. residents piease add 7% PST 
' Prices are in US, Dollars 



Add flat $2,00 shipping & handling for any number of items within this box ^ 



SCdn. $U.S. 
D\^.%' 13.95^ Transaction as, DM, nLOXl DRpd DBlue 
n 19.95" 17.95' JumlK> TvSliif[ DRed DBlue 
D 17.95 14.95' Transactor Book of Bits and Pieces*! 
8,95' Bits and Pieties Bool^ Disk 
19.95' Bits and Pieces Book AND Disk Combo 
17.95' TheTransBASIC2Disk 
8,95' lVansB.^IC 1 to TrausBASIC 2 Upgrade 

(proof of purchase required - see News BRK) 
49.95^ Transactor Microficlie Set (Vol4+Voi54^VoI6+Vol7} 
14.95' The Cunijileie CommcKlofe inner Space Anthology 



SCdn, SUS, 

D 69,95' 59,95^ 15^1 ROM Upgrade Kit 

D 14.95* 12.95' Transactor Amiga [:)i.sk"'l 

D 69 95^ 59,95' G-UNKCG^ lo IEEE Interface 



D 9.95* 
D 24.95 

D 19.95* 

D 9,95' 

D 59.95* 
D 1755 



D 19,95* 
n 129.95* 
D 29,95* 



17.95' Potpourri Disk 
99.95' The Micro Sleuth 
29,95" Moving Pictures 

Note: See News BRK for 
detmis on above items 



The Transactor Disk $8-95^ US, $9,95* Cdn each. (154 1/4040/203 1/MSD format) 

Numbers shown are Disk numbers - Volume and Issue # of the correspoi^ing magazine art stiowa m brackets 

ni(V4,*l-fi) n4(V5,-5) D7(V6,^} Dia(V6,*5) ni3(V7,*2) ni6(V7,*5) ni9{V8,'2) 

D2{V5,-1'3) D5(V5,*6) nS(V6,-3) Dll(V6.'C3 Dl4(V7,-'3) ni7(V7,*6) n2(J{V8,*;j) 

nSlVS.M) Gecve,*!) n9{V'6/4) ni2(V7.*l) Q!5(\7,''4) D18(VS,*1) n21(V8.«3) 

1 Add flat $2.00 shipping & handlmg for any number of items within this box | 



Transactor Back Issues and Microfiche: $4.50 US» $4.50*Cdn, (MF=: Microfiche) 
SPECIAL: First Back Issue $4.50, additmnal Back Issues $2.00 each! (Expires Janl/88) 

D V4, *1 D MF D V4. "6 MF only D V5, '5 □ MP D V6, -4 D MF D V7, '3 D MF D V8. ''2 D MF 

a V4, '2 D MF n V5, *1 a MF n VS, ^6 D MF D Vfi, -'5 □ MF D V7. *4 P MF D V8, ^3 n MF 

a V4, '3 MF only D V5, "2 MF only D V6, *1 D MF D V6, *6 D MP O V7. *5 □ MF D V8. "4 D MF 

D V4. '4 MF only D V5, '3 MF onlv □ V6, "2 D MF D V7, *1 D MF D V7. "6 D MF 

D V4, '5 MF only D V5, *^ MF only D V6, --3 D MF D V7. -^ D MF D V8. *1 D MF 



Please allow 6-8 weeks for delivery ui U.S., 4-6 weeks hi Canaila 



NOTE: Prepayment required- Purchase orders will be accepted ONLY if accompanied by payment. 

Amount___ 



D Visa DMasterCard D Cheque/MO, enclosed CheqLie# 



Acct. # 



Expires 



y. 



Dated 



Sgnature 



y. 



/ 



I use the following GVfC 20 DC 64 

Commodore equipment: DSFDIOOI G 1540/4 1 

[ use my equipment in the following environment: 
PHobby PBusiness DTechnioal 

a Please send advertising infofmation for Transactor. 



PCI 28 
01581 



DAmi^ 
04040 



nB128 
08050 



□8032/96 
□8250 



□ 16/ +4 
P1571 



□Public School GHigh School PCollege/Univ. GCBM Dealer 



n Please send dealer information for Transactor 



10/87 



BUSINESS REPLY MAIL 

FIRST CLASS PERMIT NO 390 BUFFALO, NY 



POSTAGE WILL BE PAID BY ADDRESSEE 



TItinsaclof 

RO. Box 338 Station 'C 
Buffalo, NY, 14209-9990 



NO POSTAGE 

NECESSARY 

IF MAILED 

IN THE 

UNITED STATES 




l,„ll.lMl..).lll...l.lMl.i..l.l..l.lMll...lM,tl 



-mimiiuammmmmmmiim 



Business Reply Mail 

No Postage Stamp Necessary 
If mtf i«d in Canada 

Postage will be paid by: 



501 Alden Road 

RO. Box 3250 

Markhom Industrial Park 
Markham, Ontario 
L3R 9Z9